Chameleon

Chameleon Commit Details

Date:2011-09-27 09:22:07 (12 years 6 months ago)
Author:blackosx
Commit:1581
Parents: 1580
Message:Got the auto generated 'exclusive' boot options working.
Changes:
M/branches/blackosx/package/Resources/en.lproj/Localizable.strings
M/branches/blackosx/package/buildpkg.sh
M/branches/blackosx/package/BootOptions/Resolution.txt

File differences

branches/blackosx/package/BootOptions/Resolution.txt
1
12
23
34
none:DONT=ADD
1024x600x32:Graphics Mode=1024x600x32
1024x768x32:Graphics Mode=1024x768x32
1280x768x32:Graphics Mode=1280x768x32
branches/blackosx/package/Resources/en.lproj/Localizable.strings
175175
176176
177177
178
179
180
178181
179
182
180183
181184
182
185
183186
184187
185
188
186189
187190
188
191
189192
190193
191
194
192195
193196
194
197
195198
196199
197
200
198201
199202
200
203
201204
202205
203
206
204207
205208
206
209
207210
208211
209
212
210213
211214
212215
"Resolution_title" = "Resolution";
"Resolution_description" = "Set the screen resolution of your display";
"none_title" = "Don't add a resolution";
"none_description" = "Don't add a resolution";
"1024x600x32_title" = "1024x600x32";
"1024x600x32_description" = "1024x600x32";
"1024x600x32_description" = "Set Graphics Mode to 1024x600x32";
"1024x768x32_title" = "1024x768x32";
"1024x768x32_description" = "1024x768x32";
"1024x768x32_description" = "Set Graphics Mode to 1024x768x32";
"1280x768x32_title" = "1280x768x32";
"1280x768x32_description" = "1280x768x32";
"1280x768x32_description" = "Set Graphics Mode to 1280x768x32";
"1280x800x32_title" = "1280x800x32";
"1280x800x32_description" = "1280x800x32";
"1280x800x32_description" = "Set Graphics Mode to 1280x800x32";
"1280x1024x32_title" = "1280x1024x32";
"1280x1024x32_description" = "1280x1024x32";
"1280x1024x32_description" = "Set Graphics Mode to 1280x1024x32";
"1280x960x32_title" = "1280x960x32";
"1280x960x32_description" = "1280x960x32";
"1280x960x32_description" = "Set Graphics Mode to 1280x960x32";
"1440x900x32_title" = "1440x900x32";
"1440x900x32_description" = "1440x900x32";
"1440x900x32_description" = "Set Graphics Mode to 1440x900x32";
"1600x900x32_title" = "1600x900x32";
"1600x900x32_description" = "1600x900x32";
"1600x900x32_description" = "Set Graphics Mode to 1600x900x32";
"1680x1050x32_title" = "1680x1050x32";
"1680x1050x32_description" = "1680x1050x32";
"1680x1050x32_description" = "Set Graphics Mode to 1680x1050x32";
"1920x1080x32_title" = "1920x1080x32";
"1920x1080x32_description" = "1920x1080x32";
"1920x1080x32_description" = "Set Graphics Mode to 1920x1080x32";
"1920x1200x32_title" = "1920x1200x32";
"1920x1200x32_description" = "1920x1200x32";
"1920x1200x32_description" = "Set Graphics Mode to 1920x1200x32";
// Video
branches/blackosx/package/buildpkg.sh
8888
8989
9090
91
91
9292
9393
9494
9595
9696
97
98
9997
10098
10199
102100
103101
104102
105
103
106104
107105
108106
......
210208
211209
212210
213
214
215
211
212
213
214
216215
217
216
217
218
219
220
221
222
223
224
225
226
227
218228
229
219230
220231
221232
......
231242
232243
233244
234
245
235246
236
237
238
239
240
241
247
248
249
242250
243251
244
245
246
247
248
249
250
251
252
253
254252
255
253
256254
257255
258256
259257
260258
261259
262
260
261
263262
264263
265
264
266265
267
268
269
270
266
267
268
269
270
271
272
273
271274
272275
273276
274
277
275278
276279
277280
278281
279
282
280283
281284
282285
mkdir -p ${1}/Standard/Root
mkdir -p ${1}/Standard/Scripts/Resources
cp -f ${pkgroot}/Scripts/Main/Standard/* ${1}/Standard/Scripts
cp -f ${pkgroot}/Scripts/Sub/* ${1}/Standard/Scripts
cp -f ${pkgroot}/Scripts/Sub/* ${1}/Standard/Scripts
ditto --arch i386 `which SetFile` ${1}/Standard/Scripts/Resources/SetFile
ditto --noextattr --noqtn ${1%/*/*}/revision ${1}/Standard/Scripts/Resources/revision
ditto --noextattr --noqtn ${1%/*/*}/version ${1}/Standard/Scripts/Resources/version
echo "[BUILD] Standard "
buildpackage "${1}/Standard" "/" "${coresize}" "start_enabled=\"true\" start_selected=\"upgrade_allowed()\" selected=\"exclusive(choices['EFI']) && exclusive(choices['noboot'])\"" >/dev/null 2>&1
# hh="selected=\"exclusive(choices['EFI']) && exclusive(choices['noboot'])\""
# buildpackage "${1}/Standard" "/" "${coresize}" "start_enabled=\"true\" start_selected=\"upgrade_allowed()\" ${hh}" >/dev/null 2>&1
# End build standard package
# build efi package
mkdir -p ${1}/EFI/Root
mkdir -p ${1}/EFI/Scripts/Resources
cp -f ${pkgroot}/Scripts/Main/EFI/* ${1}/EFI/Scripts
cp -f ${pkgroot}/Scripts/Sub/* ${1}/EFI/Scripts
cp -f ${pkgroot}/Scripts/Sub/* ${1}/EFI/Scripts
ditto --arch i386 `which SetFile` ${1}/EFI/Scripts/Resources/SetFile
ditto --noextattr --noqtn ${1%/*/*}/revision ${1}/EFI/Scripts/Resources/revision
ditto --noextattr --noqtn ${1%/*/*}/version ${1}/EFI/Scripts/Resources/version
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
# Read boot option file in to an array.
# Structure of boot option in file is name:key=value
# Note: This requires the boot option file to have
# a carriage return at the end of the last line.
# ------------------------------------------------------
while read textLine
count=0
availableOptions=()
while read textLine
do
availableOptions[count]=$textLine
((count++))
done < ${bootOptionFiles[$i]}
# ------------------------------------------------------
# Loop through options in array and process each in turn
# ------------------------------------------------------
for (( c = 0 ; c < ${#availableOptions[@]} ; c++ ))
do
textLine=${availableOptions[c]}
# split line - taking all before ':' as option name
# and all after ':' as key/value
optionName=${textLine%:*}
# ------------------------------------------------------
# Before calling buildpackage, see if any bootOptionFiles
# have requested being set to exclusive.
# have requested being set to exclusive.
# Manually set for now to 'Resolutions'.
# It can eventually be non-specifc by adding a dedicated
# field at the top of each bootOptionFiles to indicate
# if the set should be exclusive or not.
# ------------------------------------------------------
# Note: This currently fails to achieve the desired effect?
# I'll improve the code etc. once (if) I can get it working!
# It can eventually be non-specifc by adding a dedicated
# field at the top of each bootOptionFiles to indicate
# if the set should be exclusive or not.
# ------------------------------------------------------
if [ $builtOptionsFolderName = "Resolution" ]; then
# build a list of all resolutions but exclude current resolution.
arrayCount=0
while read textLineTemp
do
optionNameTemp=${textLineTemp%:*}
if [ $optionNameTemp != $optionName ]; then
resolutionArray[arrayCount]=$optionNameTemp
((arrayCount++))
fi
done < ${bootOptionFiles[$i]}
# Build exclusive string
# Prepare individual string parts
stringStart="selected=\""
stringBefore="exclusive(choices['"
stringAfter="']) &amp;&amp; "
stringEnd="'])\""
x=${stringStart}${stringBefore}
totalItems="${#resolutionArray[@]}"
# build string for sending to buildpackage
totalItems="${#availableOptions[@]}"
lastItem=$((totalItems-1))
for (( r = 0 ; r < ${#resolutionArray[@]} ; r++ ))
for (( r = 0 ; r < ${totalItems} ; r++ ))
do
x="${x}${resolutionArray[r]}"
# Only add these to end of string up to the one before the last item
if [ $r -lt $lastItem ]; then
x="${x}${stringAfter}${stringBefore}"
textLineTemp=${availableOptions[r]}
optionNameTemp=${textLineTemp%:*}
if [ "${optionNameTemp}" != "${optionName}" ]; then
x="${x}${optionNameTemp}"
# Only add these to end of string up to the one before the last item
if [ $r -lt $lastItem ]; then
x="${x}${stringAfter}${stringBefore}"
fi
fi
done
x="${x}${stringEnd}"
buildpackage "${1}/${optionName}" "/$chamTemp/options" "" "start_selected=\"false\"" ${x} >/dev/null 2>&1
buildpackage "${1}/${optionName}" "/$chamTemp/options" "" "start_selected=\"false\" ${x}" >/dev/null 2>&1
else
buildpackage "${1}/${optionName}" "/$chamTemp/options" "" "start_selected=\"false\"" >/dev/null 2>&1
fi
done < ${bootOptionFiles[$i]}
done
((xmlindent--))
outline[$((outlinecount++))]="${indent[$xmlindent]}\t</line>"

Archive Download the corresponding diff file

Revision: 1581