Chameleon

Chameleon Commit Details

Date:2011-09-28 22:37:48 (6 years 11 months ago)
Author:blackosx
Commit:1586
Parents: 1585
Message:A few more adjustments.
Changes:
M/branches/blackosx/package/buildpkg.sh
M/branches/blackosx/package/Scripts/Main/Post/postinstall
M/branches/blackosx/package/Scripts/Sub/InstallLog.sh

File differences

branches/blackosx/package/Scripts/Main/Post/postinstall
4848
4949
5050
51
51
5252
5353
5454
......
9393
9494
9595
96
97
98
96
9997
10098
10199
......
111109
112110
113111
114
112
115113
116
114
117115
118116
119117
......
128126
129127
130128
129
131130
132131
133132
134133
135134
136135
136
137137
138138
139
139140
140141
141142
142143
143144
144145
146
145147
146148
147149
148150
149151
150152
153
151154
152155
153156
"$scriptDir"InstallLog.sh "${dest_vol}" "Running Post postinstall script"
Check for temporary directory/Extra folder.
# Check for temporary directory/Extra folder.
if [ ! -d "$chamTemp"/Extra ]; then
mkdir "$chamTemp"/Extra
fi
options[arrayCount]="${FILE##*/}"
keyRead="${options[$arrayCount]%=*}"
value="${options[$arrayCount]#*=}"
echo "DEBUG: options: ${options[arrayCount]}"
# Check keyRead for 'KF' at beginning to
# indicate that should be a kernel flag
if [ ${keyRead:0:2} = "KF" ];then
else
# escape any spaces
keyToUse=$( echo $keyRead | sed 's/ /\\ /g' )
if [ ${keyToUse} != "DONT" ] && [ ${value} != "USE" ]; then
if [ "${keyToUse}" != "DONT" ] && [ "${value}" != "USE" ]; then
sudo /usr/libexec/plistbuddy -c "Add :${keyToUse} string ${value}" "$tempOCBP"
"$scriptDir"InstallLog.sh "${dest_vol}" "Add boot option: ${keyToUse}=${value}"
"$scriptDir"InstallLog.sh "${dest_vol}" "Add boot option: ${keyRead}=${value}"
fi
fi
(( arrayCount++ ))
# 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
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" )
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
branches/blackosx/package/Scripts/Sub/InstallLog.sh
1616
1717
1818
19
20
19
20
2121
2222
2323
if [ "$#" -eq 2 ]; then
logLocation="$1"
verboseText="$2"
echo "DEBUG: passed argument = $logLocation"
echo "DEBUG: passed argument = $verboseText"
echo "DEBUG: passed argument = ${logLocation}"
echo "DEBUG: passed argument = ${verboseText}"
else
echo "Error - wrong number of values passed"
exit 9
branches/blackosx/package/buildpkg.sh
246246
247247
248248
249
249
250
250251
251252
252253
......
305306
306307
307308
308
309
309310
310311
311312
......
425426
426427
427428
428
429
429430
430431
431432
......
462463
463464
464465
465
466
466467
467468
468469
# ------------------------------------------------------
availableOptions=()
availableOptions=($( find "${1%/sym/*}/Keymaps" -type f -depth 1 -name '*.lyt' | sed 's|.*/||;s|\.lyt||' ))
# add "KeyLayout=" infront of each string
# Adjust array contents to match expected format
# for boot options which is: name:key=value
for (( i = 0 ; i < ${#availableOptions[@]} ; i++ ))
do
availableOptions[i]=${availableOptions[i]}":KeyLayout="${availableOptions[i]}
# 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: 1586