Chameleon

Chameleon Commit Details

Date:2011-09-29 18:23:05 (12 years 6 months ago)
Author:blackosx
Commit:1589
Parents: 1588
Message:Fix writing more than one kernel flag to org.chameleon.Boot.plist.
Changes:
M/branches/blackosx/package/buildpkg.sh
M/branches/blackosx/package/Scripts/Main/Post/postinstall

File differences

branches/blackosx/package/Scripts/Main/Post/postinstall
9393
9494
9595
96
96
97
9798
9899
99100
100101
101102
102103
103
104
105
106
107
108
109
110
111
104
105
106
107
108
109
112110
113111
114112
......
120118
121119
122120
123
121
124122
123
124
125
126
127
128
129
130
131
132
133
134
135
125136
126137
127138
# Read list of all boot options the user added.
arrayCount=0
ls "${chamTemp}"/options | while read FILE
kernelFlagCount=0
while read FILE
do
options[arrayCount]="${FILE##*/}"
# Check keyRead for 'KF' at beginning to
# indicate that should be a kernel flag
if [ ${options[arrayCount]:0:2} = "KF" ];then
kernelflag=${options[arrayCount]##*flag=}
sudo /usr/libexec/plistbuddy -c "Add :Kernel\ Flags string $kernelflag" "$tempOCBP"
"$scriptDir"InstallLog.sh "${dest_vol}" "Added kernel flag: ${kernelflag}"
returnValue=$?
if [ ${returnValue}=1 ]; then
# Delete it for now, but need to append as more kernel flags could be added in future!!
sudo /usr/libexec/plistbuddy -c "Delete :Kernel\ Flags" "$tempOCBP"
sudo /usr/libexec/plistbuddy -c "Add :Kernel\ Flags string $kernelflag" "$tempOCBP"
fi
# plistbuddy only add's if the key doesn't already exist.
# once we reach the end of the options list.
kernelflag[kernelFlagCount]="${options[arrayCount]##*flag=}"
"$scriptDir"InstallLog.sh "${dest_vol}" "Added kernel flag: ${kernelflag[kernelFlagCount]}"
(( kernelFlagCount++ ))
else
keyRead="${options[$arrayCount]%=*}"
value="${options[$arrayCount]#*=}"
fi
fi
(( arrayCount++ ))
done
done < <(ls "${chamTemp}"/options )
if [ $kernelFlagCount -gt 0 ]; then
# Add kernel flags
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
fi
# ---------------------------------------------
# Copy temp Extra folder to target destination
branches/blackosx/package/buildpkg.sh
253253
254254
255255
256
256
257257
258258
259259
......
308308
309309
310310
311
311
312312
313313
314314
......
428428
429429
430430
431
431
432432
433433
434434
......
465465
466466
467467
468
468
469469
470470
471471
availableOptions[i]=${availableOptions[i]}":KeyLayout="${availableOptions[i]}
done
# call buildbootoptions with 1 to indicate exclusive option wanted.
# call buildoptionalsettings with 1 to indicate exclusive option wanted.
buildoptionalsettings "$1" "1" "keylayout"
((xmlindent--))
# 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: 1589