␉mkdir "$chamTemp"/Extra␊ |
fi␊ |
␊ |
# ---------------------------------------------␊ |
# Get location of this script so we know where␊ |
# to find the Install Log script.␊ |
# ---------------------------------------------␊ |
MYLOCATION="${PWD}/${BASH_ARGV[0]}"␊ |
export MYLOCATION="${MYLOCATION%/*}"␊ |
scriptDir=$MYLOCATION␊ |
␊ |
# ---------------------------------------------␊ |
# Blackosx - Build boot options / Kernel Flags.␊ |
# Build boot options / Kernel Flags.␊ |
# NEEDS MORE WORK!!!!!!!!!!!!␊ |
# ---------------------------------------------␊ |
# All options selected are now dummy files with␊ |
|
# in /usr/local/chamTemp/options/␊ |
# for example. Boot Banner=Yes␊ |
␊ |
# Write some information to the Install Log␊ |
"$scriptDir"InstallLog.sh "${3}" "Running Post postinstall script"␊ |
␊ |
# Create template for org.chameleon.Boot.plist"␊ |
tempOCBP="$chamTemp"/Extra/org.chameleon.Boot.plist␊ |
cp "$dest_vol"/Library/Preferences/SystemConfiguration/com.apple.Boot.plist "$tempOCBP"␊ |
|
do␊ |
␉options[arrayCount]="${FILE##*/}"␊ |
␉keyRead="${options[$arrayCount]%=*}"␊ |
␊ |
␉value="${options[$arrayCount]#*=}"␊ |
␊ |
␉# Check keyRead for 'KF' at beginning to␊ |
|
␉␉# but skip first one as that will be 'options'␊ |
␉␉if [ $arrayCount -gt 0 ]; then␊ |
␉␉␉sudo /usr/libexec/plistbuddy -c "Add :Kernel\ Flags string $kernelflag" "$tempOCBP"␊ |
␉␉␉"$scriptDir"InstallLog.sh "${3}" "Add 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␊ |
␉␉fi␊ |
␉else␊ |
␉␉# escape any spaces␊ |
␉␉keyToUse=$( echo $keyRead | sed 's/ /\\ /g' )␊ |
␊ |
␉␉# write value to org.chameleon.Boot.plist␊ |
␉␉# but skip first one as that will be 'options'␊ |
␉␉if [ $arrayCount -gt 0 ]; then␊ |
␉␉␉sudo /usr/libexec/plistbuddy -c "Add :$keyToUse string $value" "$tempOCBP"␊ |
␉␉echo "Add :${keyToUse} string ${value}"␊ |
␉␉␉sudo /usr/libexec/plistbuddy -c "Add :${keyToUse} string ${value}" "$tempOCBP"␊ |
␉␉␉"$scriptDir"InstallLog.sh "${3}" "Add boot option: ${keyToUse}=${value}"␊ |
␉␉fi␊ |
␉fi␊ |
␊ |
arrayCount=$(( ${arrayCount} + 1 ))␊ |
␉␊ |
␉(( arrayCount++ ))␊ |
done␊ |
␊ |
␊ |
# ---------------------------------------------␊ |
# Copy temp Extra folder to target destination␊ |
# ---------------------------------------------␊ |
# If an existing /Extra folder is found, then back it up.␊ |
# Extra folder now resides in /usr/local/chamTemp/␊ |
# Copy /usr/local/chamTemp/Extra to correct location.␊ |
␊ |
if [ ! -f "$dest_vol"/.ChameleonEFI ]; then␊ |
␉if [ ! -f "$dest_vol"/Extra ]; then␊ |
␉if [ ! -e "$dest_vol"/Extra ]; then␊ |
␉␉mkdir "$dest_vol"/Extra␊ |
␉else␊ |
␉␉"$scriptDir"InstallLog.sh "${3}" "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␊ |
␉cp -R "$chamTemp"/Extra/* "$dest_vol"/Extra␊ |
␉cp -R "$chamTemp"/Extra "$dest_vol"␊ |
else␊ |
␉if [ ! -f "/Volumes/EFI/Extra" ]; then␊ |
␉if [ ! -e "/Volumes/EFI/Extra" ]; then␊ |
␉␉mkdir "/Volumes/EFI/Extra"␊ |
␉else␊ |
␉␉"$scriptDir"InstallLog.sh "${3}" "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␊ |
␉cp -R "$chamTemp"/Extra/* /Volumes/EFI/Extra␊ |
␉cp -R "$chamTemp"/Extra "/Volumes/EFI"␊ |
␊ |
␉# unmount /Volumes/EFI␊ |
␉attempts=1␊ |
|
␊ |
# delete the temporary Chameleon folder␊ |
echo "Removing $chamTemp file"␊ |
rm -rf "$chamTemp"␊ |
#rm -rf "$chamTemp"␊ |
␊ |
␊ |
echo "Done..." |