Chameleon

Chameleon Commit Details

Date:2011-10-04 22:58:03 (12 years 6 months ago)
Author:blackosx
Commit:1600
Parents: 1599
Message:Change post script so it won't make an empty Extra folder when not needed. Turn off the exclusive setting for resolution boot options and keylayouts. A couple of other small tweaks.
Changes:
M/branches/blackosx/package/Scripts/Main/EFI/postinstall
M/branches/blackosx/package/buildpkg.sh
M/branches/blackosx/package/Scripts/Main/Post/postinstall
M/branches/blackosx/package/OptionalSettings/Resolution.txt

File differences

branches/blackosx/package/OptionalSettings/Resolution.txt
2121
2222
2323
24
24
2525
2626
2727
# B) User can select only one of the options from the list.
# Set Exclusive=False for A, or Exclusive=True for B.
#
Exclusive=True
Exclusive=False
# ---------------------------------------------
# Note: There must be a carriage return at end of last line
# ---------------------------------------------
branches/blackosx/package/Scripts/Main/EFI/postinstall
7676
7777
7878
79
7980
8081
8182
"$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "Installer version: ${versionNumber} ${revisionNumber}"
"$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "Diskutil"
"$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "Running EFI postinstall script"
"$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "Target selected by user = ${targetDeviceChosenByUser}"
"$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "Target volume = ${targetVolume}"
branches/blackosx/package/Scripts/Main/Post/postinstall
5454
5555
5656
57
58
59
57
58
59
6060
6161
6262
......
7878
7979
8080
81
8281
8382
8483
......
9089
9190
9291
92
93
94
95
96
9397
9498
9599
......
105109
106110
107111
108
109
112
113
110114
111115
112116
......
141145
142146
143147
144
148
149
150
145151
146152
147153
148
149
150
151
154
155
156
157
158
159
160
161
162
163
164
165
152166
153
154
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
155185
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177186
178187
179
180
181
182188
183189
184190
191
192
193
194
195
196
197
198
185199
186200
187201
202
188203
189204
190205
191206
192207
193
194
195
208
209
196210
197
198
199
211
212
213
214
200215
216
217
201218
202219
chamTemp="$dest_vol/usr/local/chamTemp"
# Check for temporary directory/Extra folder.
if [ ! -d "$chamTemp"/Extra ]; then
mkdir "$chamTemp"/Extra
fi
#if [ ! -d "$chamTemp"/Extra ]; then
#mkdir "$chamTemp"/Extra
#fi
# ---------------------------------------------
# Add any installed modules to the Install Log
done
fi
# ---------------------------------------------
# Build org.chameleon.Boot.plist
# ---------------------------------------------
# Are there any options to build?
if [ "$(ls -A ${chamTemp}/options )" ]; then
# Check for temporary directory/Extra folder.
if [ ! -d "$chamTemp"/Extra ]; then
mkdir "$chamTemp"/Extra
fi
# Create template for org.chameleon.Boot.plist"
tempOCBP="$chamTemp"/Extra/org.chameleon.Boot.plist
cp "$4"/Library/Preferences/SystemConfiguration/com.apple.Boot.plist "$tempOCBP"
# indicate that should be a kernel flag
if [ ${options[arrayCount]:0:2} = "KF" ];then
# plistbuddy only add's if the key doesn't already exist.
# once we reach the end of the options list.
# same time once when we reach the end of the options list.
kernelflag[kernelFlagCount]="${options[arrayCount]##*flag=}"
"$scriptDir"InstallLog.sh "${dest_vol}" "Added kernel flag: ${kernelflag[kernelFlagCount]}"
(( kernelFlagCount++ ))
# ---------------------------------------------
# Copy temp Extra folder to target destination
# ---------------------------------------------
# If an existing /Extra folder is found, then back it up.
# If we've made a temporary Extra folder to use then
# check for an existing /Extra folder. If found, back it up
# before copying the temporary Extra folder to destination.
# Extra folder now resides in /usr/local/chamTemp/
# Copy /usr/local/chamTemp/Extra to correct location.
if [ ! -f "$dest_vol"/.ChameleonEFI ]; then
# The Standard install option chosen
if [ ! -e "$dest_vol"/Extra ]; then
mkdir "$dest_vol"/Extra
if [ -d "$chamTemp"/Extra ]; then
if [ ! -f "$dest_vol"/.ChameleonEFI ]; then
# The Standard install option chosen
# Does and /Extra folder already exist?
if [ -e "$dest_vol"/Extra ]; then
"$scriptDir"InstallLog.sh "${dest_vol}" "Found existing $dest_vol/Extra folder. Renaming it $dest_vol/Extra-OLD-$( date "+%H-%M-%S" )"
mv "$dest_vol/Extra" "$dest_vol/Extra_OLD-"$( date "+%H-%M-%S" )
fi
"$scriptDir"InstallLog.sh "${dest_vol}" "Writing folder: $dest_vol/Extra"
cp -R "$chamTemp"/Extra "$dest_vol"
else
"$scriptDir"InstallLog.sh "${dest_vol}" "Found existing $dest_vol/Extra folder. Renaming it $dest_vol/Extra-OLD-$( date "+%H-%M-%S" )"
mv "$dest_vol/Extra" "$dest_vol/Extra_OLD-"$( date "+%H-%M-%S" )
# The EFI system partition install option was chosen
# Does a /Volumes/Extra folder already exist?
if [ -e "/Volumes/EFI/Extra" ]; then
"$scriptDir"InstallLog.sh "${dest_vol}" "Found existing /Volumes/EFI/Extra folder. Renaming it Extra-OLD-$( date "+%H-%M-%S" )"
mv "/Volumes/EFI/Extra" "/Volumes/EFI/Extra_OLD-"$( date "+%H-%M-%S" )
fi
"$scriptDir"InstallLog.sh "${dest_vol}" "Writing folder: /Volumes/EFI/Extra"
cp -R "$chamTemp"/Extra "/Volumes/EFI"
# unmount /Volumes/EFI
attempts=1
while [ "$( df | grep EFI )" ] && [ "${attempts}" -lt 5 ]; do
echo "Unmounting $( df | grep EFI | awk '{print $1}' )"
"$scriptDir"InstallLog.sh "${dest_vol}" "Unmounting $( df | grep EFI | awk '{print $1}' )"
umount -f $( df | grep EFI | awk '{print $1}' )
attempts=$(( ${attempts} + 1 ))
done
fi
"$scriptDir"InstallLog.sh "${dest_vol}" "Writing folder: $dest_vol/Extra"
cp -R "$chamTemp"/Extra "$dest_vol"
else
# The EFI system partition install option was chosen
if [ ! -e "/Volumes/EFI/Extra" ]; then
mkdir "/Volumes/EFI/Extra"
else
"$scriptDir"InstallLog.sh "${dest_vol}" "Found existing /Volumes/EFI/Extra folder. Renaming it Extra-OLD-$( date "+%H-%M-%S" )"
mv "/Volumes/EFI/Extra" "/Volumes/EFI/Extra_OLD-"$( date "+%H-%M-%S" )
fi
"$scriptDir"InstallLog.sh "${dest_vol}" "Writing folder: /Volumes/EFI/Extra"
cp -R "$chamTemp"/Extra "/Volumes/EFI"
# unmount /Volumes/EFI
attempts=1
while [ "$( df | grep EFI )" ] && [ "${attempts}" -lt 5 ]; do
echo "Unmounting $( df | grep EFI | awk '{print $1}' )"
"$scriptDir"InstallLog.sh "${dest_vol}" "Unmounting $( df | grep EFI | awk '{print $1}' )"
umount -f $( df | grep EFI | awk '{print $1}' )
attempts=$(( ${attempts} + 1 ))
done
fi
"$scriptDir"InstallLog.sh "${dest_vol}" "LineBreak"
"$scriptDir"InstallLog.sh "${dest_vol}" "Post script complete"
# ---------------------------------------------
# Cleanup
# ---------------------------------------------
# delete the temporary Chameleon folder
if [ -e "$chamTemp" ]; then
echo "Removing $chamTemp directory"
"$scriptDir"InstallLog.sh "${dest_vol}" "Cleanup 1"
rm -rf "$chamTemp"
fi
# Remove /.ChameleonEFI file
if [ -f "$dest_vol"/.ChameleonEFI ]; then
echo "Removing /.ChameleonEFI file"
"$scriptDir"InstallLog.sh "${dest_vol}" "Cleanup 2"
rm "$dest_vol"/.ChameleonEFI
fi
# Remove /.ChameleonLogFlag file
if [ -f "$dest_vol"/.ChameleonLogFlag ]; then
echo "Removing /.ChameleonLogFlag file"
rm "$dest_vol"/.ChameleonLogFlag
fi
echo "Removing /.ChameleonLogFlag file"
"$scriptDir"InstallLog.sh "${dest_vol}" "Cleanup 3"
# delete the temporary Chameleon folder
echo "Removing $chamTemp file"
rm -rf "$chamTemp"
# we have to add the final install log messages before
# deleting /.ChameleonLogFlag.
"$scriptDir"InstallLog.sh "${dest_vol}" "LineBreak"
"$scriptDir"InstallLog.sh "${dest_vol}" "Post script complete"
rm "$dest_vol"/.ChameleonLogFlag
fi
echo "Done..."
branches/blackosx/package/buildpkg.sh
256256
257257
258258
259
260
259
260
261261
262262
263263
availableOptions[i]=${availableOptions[i]}":KeyLayout="${availableOptions[i]}
done
# call buildoptionalsettings with 1 to indicate exclusive option wanted.
buildoptionalsettings "$1" "1" "keylayout"
# to indicate exclusive option, call buildoptionalsettings with the 2nd parameter set to 1 .
buildoptionalsettings "$1" "0" "keylayout"
((xmlindent--))
outline[$((outlinecount++))]="${indent[$xmlindent]}\t</line>"

Archive Download the corresponding diff file

Revision: 1600