Chameleon

Chameleon Commit Details

Date:2011-10-25 22:42:52 (12 years 5 months ago)
Author:blackosx
Commit:1662
Parents: 1661
Message:Add merging of kernel flags.
Changes:
M/branches/blackosx/package/Scripts/Main/postinstall

File differences

branches/blackosx/package/Scripts/Main/postinstall
131131
132132
133133
134
134
135135
136136
137
138137
139138
140
141
142
143
144
139
145140
146141
147142
......
179174
180175
181176
182
183
184
177
178
179
180
185181
186182
187183
......
190186
191187
192188
193
194
195189
190
191
192
193
194
195
196
197
198
196199
197200
201
202
203
204
205
206
207
208
198209
199210
200211
fi
if [ $kernelFlagCount -gt 0 ]; then
# Add kernel flags
# Add any kernel flags together in to one string.
for (( i=0 ; i < $kernelFlagCount ; i++ ))
do
# Add any kernel flags together in to one string.
kernelFlagString="${kernelFlagString} ${kernelflag[i]}"
done
sudo /usr/libexec/plistbuddy -c "Add :Kernel\ Flags string $kernelFlagString" "$tempOCBP"
if [ ${returnValue}=1 ]; then # key already exists.
sudo /usr/libexec/plistbuddy -c "Delete :Kernel\ Flags" "$tempOCBP"
sudo /usr/libexec/plistbuddy -c "Add :Kernel\ Flags string $kernelFlagString" "$tempOCBP"
fi
# We add the final string in the next section.
fi
fi
fi
# Before merging org.chameleon.Boot.plist, copy any
# existing kernel flags.
# existing kernel flags, then delete the entry.
currentFlags=$( sudo /usr/libexec/plistbuddy -c "Print :Kernel\ Flags" "$tempOCBP" )
sudo /usr/libexec/plistbuddy -c "Delete :Kernel\ Flags" "$tempOCBP"
# Merge new org.chameleon.Boot.plist (holding.plist)
# with their currently existing one.
"$scriptDir"InstallLog.sh "${dest_vol}" "Merging new options into org.chameleon.Boot.plist.
NOTE: For example: If you already had Wait=No as a boot option
NOTE: and chose Wait=Yes from the list, this will NOT be changed."
sudo /usr/libexec/plistbuddy -c "Merge $chamTemp/holding.plist" "$tempOCBP"
# TO DO - kernel flags! - maybe read existing, delete them, re-add existing and new?
# Combine new kernel flags with old ones.
kernelFlagString="${kernelFlagString} $currentFlags"
# Write complete kernel flag entry back.
sudo /usr/libexec/plistbuddy -c "Add :Kernel\ Flags string $kernelFlagString" "$tempOCBP"
if [ ${returnValue}=1 ]; then # key already exists.
sudo /usr/libexec/plistbuddy -c "Delete :Kernel\ Flags" "$tempOCBP"
sudo /usr/libexec/plistbuddy -c "Add :Kernel\ Flags string $kernelFlagString" "$tempOCBP"
fi
elif [ -e "$chamTemp/install_type_new" ]; then
"$scriptDir"InstallLog.sh "${dest_vol}" "User selected to make a new install."
# Add kernel flags (if any)
if [ $kernelFlagCount -gt 0 ]; then
sudo /usr/libexec/plistbuddy -c "Add :Kernel\ Flags string $kernelFlagString" "$tempOCBP"
if [ ${returnValue}=1 ]; then # key already exists.
sudo /usr/libexec/plistbuddy -c "Delete :Kernel\ Flags" "$tempOCBP"
sudo /usr/libexec/plistbuddy -c "Add :Kernel\ Flags string $kernelFlagString" "$tempOCBP"
fi
fi
fi
# ---------------------------------------------

Archive Download the corresponding diff file

Revision: 1662