Chameleon

Chameleon Commit Details

Date:2011-09-26 16:44:30 (8 years 20 days ago)
Author:blackosx
Commit:1578
Parents: 1577
Message:Work on the next stage of simplifying the creation/management of installer boot options. Still a work in progress.
Changes:
D/branches/blackosx/package/Scripts/Advanced
D/branches/blackosx/package/Scripts/BaseOptions
D/branches/blackosx/package/Scripts/Resolutions
A/branches/blackosx/package/BootOptions/General.txt
A/branches/blackosx/package/BootOptions/KernelFlags.txt
A/branches/blackosx/package/BootOptions/Control.txt
A/branches/blackosx/package/BootOptions
A/branches/blackosx/package/BootOptions/Resolution.txt
A/branches/blackosx/package/BootOptions/Video.txt
A/branches/blackosx/package/BootOptions/PowerManagement.txt
M/branches/blackosx/package/Resources/en.lproj/Localizable.strings
M/branches/blackosx/package/buildpkg.sh

File differences

branches/blackosx/package/BootOptions/Resolution.txt
1
2
3
4
5
6
7
8
9
10
11
1024x600x32:Graphics Mode=1024x600x32
1024x768x32:Graphics Mode=1024x768x32
1280x768x32:Graphics Mode=1280x768x32
1280x800x32:Graphics Mode=1280x800x32
1280x960x32:Graphics Mode=1280x960x32
1280x1024x32:Graphics Mode=1280x1024x32
1440x900x32:Graphics Mode=1440x900x32
1600x900x32:Graphics Mode=1600x900x32
1680x1050x32:Graphics Mode=1680x1050x32
1920x1080x32:Graphics Mode=1920x1080x32
1920x1200x32:Graphics Mode=1920x1200x32
branches/blackosx/package/BootOptions/Video.txt
1
2
3
4
GraphicsEnabler:GraphicsEnabler=Yes
UseAtiROM:UseAtiROM=Yes
UseNvidiaROM:UseNvidiaROM=Yes
VBIOS:VBIOS=Yes
branches/blackosx/package/BootOptions/PowerManagement.txt
1
2
3
4
5
6
7
CSTUsingSystemIO:CSTUsingSystemIO=Yes
DropSSDT:DropSSDT=Yes
EnableC2State:EnableC2State=Yes
EnableC3State:EnableC3State=Yes
EnableC4State:EnableC4State=Yes
GenerateCStates:GenerateCStates=Yes
GeneratePStates:GeneratePStates=Yes
branches/blackosx/package/BootOptions/General.txt
1
2
3
4
5
6
7
8
9
10
arch:arch=i386
EHCIacquire:EHCIacquire=Yes
EthernetBuiltIn:EthernetBuiltIn=Yes
ForceHPET:ForceHPET=Yes
ForceWake:ForceWake=Yes
RestartFix:RestartFix=No
UHCIreset:UHCIreset=Yes
UseMemDetect:UseMemDetect=No
UseKernelCache:UseKernelCache=Yes
Wake:Wake=Yes
branches/blackosx/package/BootOptions/KernelFlags.txt
1
Npci:KF npci=0x2000
branches/blackosx/package/BootOptions/Control.txt
1
2
3
4
5
6
7
BootBanner:Boot Banner=No
GUI:GUI=No
LegacyLogo:Legacy Logo=Yes
InstantMenu:Instant Menu=Yes
QuietBoot:QuietBoot=Yes
ShowInfo:ShowInfo=No
Wait:Wait=Yes
branches/blackosx/package/Resources/en.lproj/Localizable.strings
11
2
2
33
44
55
......
5656
5757
5858
59
5960
6061
6162
......
6970
7071
7172
72
73
7374
7475
7576
76
77
7877
79
80
78
79
80
8181
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
11682
11783
11884
85
86
87
11988
12089
12190
122
123
91
92
12493
125
126
94
95
12796
128
129
97
98
13099
131100
132101
133102
134
135
136103
137
138
139104
140
141
105
106
107
142108
143
144
109
110
145111
146
147
112
113
148114
149
150
115
116
151117
152118
153119
......
155121
156122
157123
158
159
124
125
160126
161127
162128
......
167133
168134
169135
170
171
172
136
137
173138
174
175
176139
177
178
140
141
142
179143
180
181
144
145
182146
183
184
185147
186
187
148
149
150
188151
189
190
152
153
191154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
192174
193175
194176
......
226208
227209
228210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
229252
230253
231254
"Chameleon_title" = "Chameleon Bootloader";
"Chameleon_title" = "Bootloader & Modules";
"Chameleon_description" = "Chameleon requires three essential files. (in simple terms)
boot0 (On the drive's MBR) responsible for loading boot1.
boot1 (On the partition's boot-sector) to finding boot2.
"Keylayout_title" = "Keylayout";
"Keylayout_description" = "This module permits the user to define the keyboard key mappings.";
// Utility
"Utility_title" = "Utilities";
"Utility_description" = "Optional files to help setup";
"Documentation_title" = "Documentation";
"Documentation_description" = "Documentation for Chameleon manual install and use";
// Options
// Boot Options
"Options_title" = "Boot Options";
"Options_description" = "Create an /Extra/org.chameleon.Boot.plist and select your desired options to control Chameleon's settings.";
"arch_title" = "arch=i386";
"arch_description" = "Boots the kernel in 32bit mode rather than the default 64bit mode.";
"InstantMenu_title" = "InstantMenu=Yes";
"InstantMenu_description" = "Display the partition selection screen without showing the timeout screen.";
// Control
"Control_title" = "Control Options";
"Control_description" = "Settings to control the way Chameleon works.";
"QuietBoot_title" = "QuietBoot=Yes";
"QuietBoot_description" = "Enable quiet boot mode (no messages or prompt).";
"RestartFix_title" = "RestartFix=No";
"RestartFix_description" = "Disables the automatically enabled restart fix.";
"ShowInfo_title" = "ShowInfo=No";
"ShowInfo_description" = "Disables display of partition and resolution details.";
"DropSSDT_title" = "DropSSDT=Yes";
"DropSSDT_description" = "Discard the motherboard's built-in SSDT tables.";
"EthernetBuiltIn_title" = "EthernetBuiltIn=Yes";
"EthernetBuiltIn_description" = "Enables the option of adding 'built-in' to your ethernet devices.";
"GraphicsEnabler_title" = "GraphicsEnabler=Yes";
"GraphicsEnabler_description" = "Enables the option to autodetect NVIDIA based GPUs and inject the correct info.";
"EnableC2State_title" = "EnableC2State=Yes";
"EnableC2State_description" = "Enable specific Processor power state, C2.";
"EnableC3State_title" = "EnableC3State=Yes";
"EnableC3State_description" = "Enable specific Processor power state, C3.";
"EnableC4State_title" = "EnableC4State=Yes";
"EnableC4State_description" = "Enable specific Processor power state, C4.";
// Advanced
"Advanced_title" = "Advanced";
"Advanced_description" = "Select your advanced desired options to control Chameleon's settings.";
"Npci_title" = "npci=0x2000";
"Npci_description" = "Set the flag npci=0x2000 for the Kernel Flags";
"BootBanner_title" = "BootBanner=No";
"BootBanner_description" = "Hides Chameleon's boot banner in GUI.";
"GUI_title" = "GUI=No";
"GUI_description" = "Disables the default enabled graphic user interface.";
"LegacyLogo_title" = "LegacyLogo=Yes";
"LegacyLogo_description" = "Use the legacy (grey on white) apple logo on the boot screen rather than the boot.png in the theme.";
"SMBIOSdefaults_title" = "SMBIOSdefaults=Yes";
"SMBIOSdefaults_description" = "Enables SMBIOSdefaults options.";
"InstantMenu_title" = "InstantMenu=Yes";
"InstantMenu_description" = "Display the partition selection screen without showing the timeout screen.";
"UseAtiROM_title" = "UseAtiROM=Yes";
"UseAtiROM_description" = "Enables UseAtiROM options.";
"QuietBoot_title" = "QuietBoot=Yes";
"QuietBoot_description" = "Enable quiet boot mode (no messages or prompt).";
"UseNvidiaROM_title" = "UseNvidiaROM=Yes";
"UseNvidiaROM_description" = "Enables UseNvidiaROM options.";
"ShowInfo_title" = "ShowInfo=No";
"ShowInfo_description" = "Disables display of partition and resolution details.";
"Wait_title" = "Wait=Yes";
"Wait_description" = "Pauses the boot process after Chameleon has finished it's setup then waits for a key press before it starts the mach kernel. Useful when combined with verbose boot for troubleshooting.";
"Wake_title" = "Wake=Yes";
"Wake_description" = "Attempts to load the sleep image saved from last hibernation.";
"GUI_title" = "GUI=No";
"GUI_description" = "Disables the default enabled graphic user interface.";
"VBIOS_title" = "VBIOS=Yes";
"VBIOS_description" = "Enables VBIOS option";
// General
"General_title" = "General Options";
"General_description" = "Choose from a selection of base options.";
"GenerateCStates_title" = "Generate C-States=Yes";
"GenerateCStates_description" = "Enable auto generation of processor idle sleep states (C-States).";
"arch_title" = "arch=i386";
"arch_description" = "Boots the kernel in 32bit mode rather than the default 64bit mode.";
"GeneratePStates_title" = "Generate P-States=Yes";
"GeneratePStates_description" = "Enable auto generation of processor power performance states (P-States).";
"EHCIacquire_title" = "EHCIacquire=Yes";
"EHCIacquire_description" = "Enables the option to fix any EHCI ownership issues due to bad bioses.";
"CSTUsingSystemIO_title" = "New - Generate C-States=Yes";
"CSTUsingSystemIO_description" = "New C-State _CST generation method using SystemIO registers instead of FixedHW.";
"EthernetBuiltIn_title" = "EthernetBuiltIn=Yes";
"EthernetBuiltIn_description" = "Enables the option of adding 'built-in' to your ethernet devices.";
"ForceHPET_title" = "ForceHPET=Yes";
"ForceHPET_description" = "Enables HPET on intel chipsets, for bioses that dont include the option.";
"ForceWake_title" = "ForceWake=Yes";
"ForceWake_description" = "This option enables you to bypass bad sleep images.";
"EHCIacquire_title" = "EHCIacquire=Yes";
"EHCIacquire_description" = "Enables the option to fix any EHCI ownership issues due to bad bioses.";
"RestartFix_title" = "RestartFix=No";
"RestartFix_description" = "Disables the automatically enabled restart fix.";
"UHCIreset_title" = "UHCIreset=Yes";
"UHCIreset_description" = "Enables the option to reset UHCI controllers before starting OS X.";
"UseKernelCache_title" = "UseKernelCache=Yes";
"UseKernelCache_description" = "For Lion only. Enables loading of the pre-linked kernel. This will ignore /E/E and /S/L/E. ONLY use this is you have know it contains everything you need.";
// KeyLayout
"KeyLayout_title" = "KeyLayout";
"KeyLayout_description" = "Set keylayout to use";
"Wake_title" = "Wake=Yes";
"Wake_description" = "Attempts to load the sleep image saved from last hibernation.";
"mac-de_title" = "German Mac Keyboard";
"mac-de_description" = "Use the keyboard layout for a German Mac keyboard";
"mac-es_title" = "Spanish Mac Keyboard";
"mac-es_description" = "Use the keyboard layout for a Spanish Mac keyboard";
// KernelFlags
"KernelFlags_title" = "Kernel Flags";
"KernelFlags_description" = "Choose from a selection of kernel flags.";
"mac-fr_title" = "French Mac Keyboard";
"mac-fr_description" = "Use the keyboard layout for a French Mac keyboard";
"Npci_title" = "npci=0x2000";
"Npci_description" = "Set the flag npci=0x2000 for the Kernel Flags";
"mac-it_title" = "Italian Mac Keyboard";
"mac-it_description" = "Use the keyboard layout for an Italian Mac keyboard";
"mac-se_title" = "Swedish Mac Keyboard";
"mac-se_description" = "Use the keyboard layout for a Swedish Mac keyboard";
// PowerManagement
"PowerManagement_title" = "Power Management";
"PowerManagement_description" = "A selection of options that deal with power management and speedstep.";
"pc-fr_title" = "French PC Keyboard";
"pc-fr_description" = "Use the keyboard layout for a French PC keyboard";
"CSTUsingSystemIO_title" = "Generate C-States=Yes";
"CSTUsingSystemIO_description" = "New C-State _CST generation method using SystemIO registers instead of FixedHW.";
"DropSSDT_title" = "DropSSDT=Yes";
"DropSSDT_description" = "Discard the motherboard's built-in SSDT tables.";
"EnableC2State_title" = "EnableC2State=Yes";
"EnableC2State_description" = "Enable specific Processor power state, C2.";
"EnableC3State_title" = "EnableC3State=Yes";
"EnableC3State_description" = "Enable specific Processor power state, C3.";
"EnableC4State_title" = "EnableC4State=Yes";
"EnableC4State_description" = "Enable specific Processor power state, C4.";
"GenerateCStates_title" = "Generate C-States=Yes";
"GenerateCStates_description" = "Enable auto generation of processor idle sleep states (C-States).";
"GeneratePStates_title" = "Generate P-States=Yes";
"GeneratePStates_description" = "Enable auto generation of processor power performance states (P-States).";
// Resolution
"Resolution_title" = "Resolution";
"Resolution_description" = "Set the screen resolution of your display";
"1920x1200x32_title" = "1920x1200x32";
"1920x1200x32_description" = "1920x1200x32";
// Video
"Video_title" = "Video";
"Video_description" = "A selection of options that deal with video.";
"GraphicsEnabler_title" = "GraphicsEnabler=Yes";
"GraphicsEnabler_description" = "Enables the option to autodetect NVIDIA based GPUs and inject the correct info.";
"UseAtiROM_title" = "UseAtiROM=Yes";
"UseAtiROM_description" = "Enables UseAtiROM options.";
"UseNvidiaROM_title" = "UseNvidiaROM=Yes";
"UseNvidiaROM_description" = "Enables UseNvidiaROM options.";
"VBIOS_title" = "VBIOS=Yes";
"VBIOS_description" = "Enables VBIOS option";
// KeyLayout
"KeyLayout_title" = "KeyLayout";
"KeyLayout_description" = "Set keylayout to use";
"mac-de_title" = "German Mac Keyboard";
"mac-de_description" = "Use the keyboard layout for a German Mac keyboard";
"mac-es_title" = "Spanish Mac Keyboard";
"mac-es_description" = "Use the keyboard layout for a Spanish Mac keyboard";
"mac-fr_title" = "French Mac Keyboard";
"mac-fr_description" = "Use the keyboard layout for a French Mac keyboard";
"mac-it_title" = "Italian Mac Keyboard";
"mac-it_description" = "Use the keyboard layout for an Italian Mac keyboard";
"mac-se_title" = "Swedish Mac Keyboard";
"mac-se_description" = "Use the keyboard layout for a Swedish Mac keyboard";
"pc-fr_title" = "French PC Keyboard";
"pc-fr_description" = "Use the keyboard layout for a French PC keyboard";
// Themes
"Themes_title" = "Themes";
"Themes_description" = "A collection of sample themes
branches/blackosx/package/buildpkg.sh
183183
184184
185185
186
186
187187
188188
189189
190190
191
192
193
194
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
195216
196
197
198
199
200
201
217
218
219
220
202221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
203237
204238
205239
......
216250
217251
218252
219
220253
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
254
238255
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258256
259257
258
260259
261260
262261
......
298297
299298
300299
301
300
302301
303302
304303
......
339338
340339
341340
342
341
343342
344343
345344
......
376375
377376
378377
379
378
380379
381380
382381
# build Extras package
# build options packages
echo "================= Options ================="
outline[$((outlinecount++))]="${indent[$xmlindent]}\t<line choice=\"Options\">"
choices[$((choicescount++))]="<choice\n\tid=\"Options\"\n\ttitle=\"Options_title\"\n\tdescription=\"Options_description\"\n>\n</choice>\n"
((xmlindent++))
# build base options packages
packagesidentity="org.chameleon.options"
options=($( find "${pkgroot}/Scripts/BaseOptions" -type d -depth 1 -not -name '.svn' ))
for (( i = 0 ; i < ${#options[@]} ; i++ ))
# ------------------------------------------------------
# parse BootOptions folder to find files of boot options.
# ------------------------------------------------------
bootOptionsFolder="${pkgroot}/BootOptions"
bootOptionFiles=($( find "${bootOptionsFolder}" -depth 1 -not -name '.svn' ))
for (( i = 0 ; i < ${#bootOptionFiles[@]} ; i++ ))
do
# Take filename and Strip .txt from end and path from front
builtOptionsFolderName=$( echo ${bootOptionFiles[$i]%.txt} )
builtOptionsFolderName=$( echo ${builtOptionsFolderName##*/} )
echo "================= $builtOptionsFolderName ================="
outline[$((outlinecount++))]="${indent[$xmlindent]}\t<line choice=\"${builtOptionsFolderName}\">"
choices[$((choicescount++))]="<choice\n\tid=\"${builtOptionsFolderName}\"\n\ttitle=\"${builtOptionsFolderName}_title\"\n\tdescription=\"${builtOptionsFolderName}_description\"\n>\n</choice>\n"
((xmlindent++))
packagesidentity="org.chameleon.options.$builtOptionsFolderName"
# ------------------------------------------------------
# Read boot option file. for example, Resolutions.txt.
# Each line in the file is a boot option to add.
# Structure of boot option in file is name:key=value
# ------------------------------------------------------
while read textLine
do
mkdir -p "${1}/${options[$i]##*/}/Root"
cp "${options[$i]}"/* "${1}/${options[$i]##*/}/Root"
echo "[BUILD] ${options[$i]##*/} "
buildpackage "${1}/${options[$i]##*/}" "/$chamTemp/options" "" "start_selected=\"false\"" >/dev/null 2>&1
done
# End build base options packages
# split line - taking all before ':' as option name
# and all after ':' as key/value
optionName=${textLine%:*}
keyValue=${textLine##*:}
# create folders required for each boot option
mkdir -p "${1}/$optionName/Root/"
# create dummy file with name of key/value
echo "" > "${1}/$optionName/Root/${keyValue}"
echo "[BUILD] ${optionName} "
buildpackage "${1}/${optionName}" "/$chamTemp/options" "" "start_selected=\"false\"" >/dev/null 2>&1
done < ${bootOptionFiles[$i]}
((xmlindent--))
outline[$((outlinecount++))]="${indent[$xmlindent]}\t</line>"
done
# build KeyLayout options packages
echo "================= Keymaps Options ================="
outline[$((outlinecount++))]="${indent[$xmlindent]}\t<line choice=\"KeyLayout\">"
done
((xmlindent--))
outline[$((outlinecount++))]="${indent[$xmlindent]}\t</line>"
# End build base options packages
# build resolution packages
echo "================= Res. Options ================="
outline[$((outlinecount++))]="${indent[$xmlindent]}\t<line choice=\"Resolution\">"
choices[$((choicescount++))]="<choice\n\tid=\"Resolution\"\n\ttitle=\"Resolution_title\"\n\tdescription=\"Resolution_description\"\n>\n</choice>\n"
((xmlindent++))
packagesidentity="org.chameleon.options.resolution"
resolutions=($( find "${pkgroot}/Scripts/Resolutions" -type d -depth 1 -not -name '.svn' ))
for (( i = 0 ; i < ${#resolutions[@]} ; i++ ))
do
mkdir -p "${1}/${resolutions[$i]##*/}/Root/"
cp "${resolutions[$i]}"/* "${1}/${resolutions[$i]##*/}/Root"
echo "[BUILD] ${resolutions[$i]##*/} "
buildpackage "${1}/${resolutions[$i]##*/}" "/$chamTemp/options" "" "start_selected=\"false\"" >/dev/null 2>&1
done
((xmlindent--))
outline[$((outlinecount++))]="${indent[$xmlindent]}\t</line>"
# End build resolution packages
# End build KeyLayout options packages
# build Advanced packages
echo "================= Adv. Options ================="
outline[$((outlinecount++))]="${indent[$xmlindent]}\t<line choice=\"Advanced\">"
choices[$((choicescount++))]="<choice\n\tid=\"Advanced\"\n\ttitle=\"Advanced_title\"\n\tdescription=\"Advanced_description\"\n>\n</choice>\n"
((xmlindent++))
packagesidentity="org.chameleon.options.advanced"
optionsadv=($( find "${pkgroot}/Scripts/Advanced" -type d -depth 1 -not -name '.svn' ))
for (( i = 0 ; i < ${#optionsadv[@]} ; i++ ))
do
mkdir -p "${1}/${optionsadv[$i]##*/}/Root"
cp "${optionsadv[$i]}"/* "${1}/${optionsadv[$i]##*/}/Root"
echo "[BUILD] ${optionsadv[$i]##*/} "
buildpackage "${1}/${optionsadv[$i]##*/}" "/$chamTemp/options" "" "start_selected=\"false\"" >/dev/null 2>&1
done
((xmlindent--))
outline[$((outlinecount++))]="${indent[$xmlindent]}\t</line>"
# End build Advanced packages
((xmlindent--))
outline[$((outlinecount++))]="${indent[$xmlindent]}\t</line>"
# End build options packages
# build theme packages
# clean up
rm -R -f "${1}"
#rm -R -f "${1}"
}
header+="auth=\"root\">\n"
header+="\t<payload installKBytes=\"${installedsize##* }\" numberOfFiles=\"${filecount##* }\"/>\n"
rm -R -f "${1}/Temp"
#rm -R -f "${1}/Temp"
[ -d "${1}/Temp" ] || mkdir -m 777 "${1}/Temp"
[ -d "${1}/Root" ] && mkbom "${1}/Root" "${1}/Temp/Bom"
fi
choices[$((choicescount++))]="<choice\n\tid=\"${packagename// /}\"\n\ttitle=\"${packagename}_title\"\n\tdescription=\"${packagename}_description\"\n${choiceoptions}>\n\t<pkg-ref id=\"${identifier}\" installKBytes='${installedsize}' version='${version}.0.0.${timestamp}' auth='root'>#${packagename// /}.pkg</pkg-ref>\n</choice>\n"
rm -R -f "${1}"
#rm -R -f "${1}"
fi
}

Archive Download the corresponding diff file

Revision: 1578