Index: branches/blackosx/package/Scripts/Main/EFI/postinstall =================================================================== --- branches/blackosx/package/Scripts/Main/EFI/postinstall (revision 1583) +++ branches/blackosx/package/Scripts/Main/EFI/postinstall (revision 1584) @@ -144,8 +144,8 @@ if [ ${returnValue} = 0 ]; then # OK to proceed - # Append a line break to the installer log - "$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "Line Break" + # Append a LineBreak to the installer log + "$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "LineBreak" if [ ${diskupdate} = "0" ]; then #echo "Diskupdate = true, so the stage 0 loader can be written to the MBR" @@ -163,8 +163,8 @@ # Write the stage 2 loader to the root of the selected partition "$scriptDir"WriteChameleonStage2.sh "${espformat}" "${stage2Loader}" "${targetVolume}" "${targetDevice}" "${targetVolumeChosenByUser}" "${scriptDir}" - # Append a line break to the installer log - "$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "Line Break" + # Append a LineBreak to the installer log + "$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "LineBreak" # Set the active partition ONLY if Windows is not installed "$scriptDir"SetActivePartition.sh "${espformat}" "${diskSigCheck}" "${targetDiskRaw}" "${targetSlice}" "${targetVolumeChosenByUser}" "${scriptDir}" @@ -194,7 +194,7 @@ # boot option scripts than EFI (ESP) option was chosen echo "EFI" >"${targetVolumeChosenByUser}"/.ChameleonEFI -"$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "Line Break" +"$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "LineBreak" "$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "EFI script complete" echo "===============================================" Index: branches/blackosx/package/Scripts/Main/Post/postinstall =================================================================== --- branches/blackosx/package/Scripts/Main/Post/postinstall (revision 1583) +++ branches/blackosx/package/Scripts/Main/Post/postinstall (revision 1584) @@ -33,75 +33,89 @@ dest_vol="$3" 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 + # set temporary directory -chamTemp="$dest_vol/usr/local/chamTemp" #blackosx added +chamTemp="$dest_vol/usr/local/chamTemp" -# Check for temporary directory/Extra folder. +# Write script information to the Install Log +"$scriptDir"InstallLog.sh "${dest_vol}" "Running Post postinstall script" + + +Check for temporary directory/Extra folder. if [ ! -d "$chamTemp"/Extra ]; then mkdir "$chamTemp"/Extra fi # --------------------------------------------- -# Get location of this script so we know where -# to find the Install Log script. +# Add any installed modules to the Install Log # --------------------------------------------- -MYLOCATION="${PWD}/${BASH_ARGV[0]}" -export MYLOCATION="${MYLOCATION%/*}" -scriptDir=$MYLOCATION +if [ -e "${chamTemp}"/Extra/modules ]; then + ls "${chamTemp}"/Extra/modules | while read FILE + do + "$scriptDir"InstallLog.sh "${dest_vol}" "Installed module:$FILE" + done +fi + +# --------------------------------------------- +# Add any installed themes to the Install Log +# --------------------------------------------- +if [ -e "${chamTemp}"/Extra/Themes ]; then + ls "${chamTemp}"/Extra/Themes | while read FILE + do + "$scriptDir"InstallLog.sh "${dest_vol}" "Installed Theme:$FILE" + done +fi + # --------------------------------------------- -# Build boot options / Kernel Flags. -# NEEDS MORE WORK!!!!!!!!!!!! +# Build org.chameleon.Boot.plist # --------------------------------------------- # All options selected are now dummy files with # the filename of the option and value residing # 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" +cp "$4"/Library/Preferences/SystemConfiguration/com.apple.Boot.plist "$tempOCBP" # Read list of all boot options the user added. arrayCount=0 -find ${chamTemp}/options | while read FILE +ls "${chamTemp}"/options | while read FILE do 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 kernelflag=${keyRead#*F }=$value - - # 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 :Kernel\ Flags string $kernelflag" "$tempOCBP" + "$scriptDir"InstallLog.sh "${dest_vol}" "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" - "$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 - echo "Add :${keyToUse} string ${value}" + if [ ${keyToUse} != "DONT" ] && [ ${value} != "USE" ]; then sudo /usr/libexec/plistbuddy -c "Add :${keyToUse} string ${value}" "$tempOCBP" - "$scriptDir"InstallLog.sh "${3}" "Add boot option: ${keyToUse}=${value}" + "$scriptDir"InstallLog.sh "${dest_vol}" "Add boot option: ${keyToUse}=${value}" fi - fi - + fi (( arrayCount++ )) done @@ -117,7 +131,7 @@ 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" )" + "$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 cp -R "$chamTemp"/Extra "$dest_vol" @@ -125,18 +139,18 @@ 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" )" + "$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 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}' )" - umount -f $( df | grep EFI | awk '{print $1}' ) - attempts=$(( ${attempts} + 1 )) - done + while [ "$( df | grep EFI )" ] && [ "${attempts}" -lt 5 ]; do + echo "Unmounting $( df | grep EFI | awk '{print $1}' )" + umount -f $( df | grep EFI | awk '{print $1}' ) + attempts=$(( ${attempts} + 1 )) + done fi @@ -157,7 +171,9 @@ # delete the temporary Chameleon folder echo "Removing $chamTemp file" -#rm -rf "$chamTemp" +rm -rf "$chamTemp" +"$scriptDir"InstallLog.sh "${dest_vol}" "LineBreak" +"$scriptDir"InstallLog.sh "${dest_vol}" "Post script complete" echo "Done..." \ No newline at end of file Index: branches/blackosx/package/Scripts/Sub/InstallLog.sh =================================================================== --- branches/blackosx/package/Scripts/Sub/InstallLog.sh (revision 1583) +++ branches/blackosx/package/Scripts/Sub/InstallLog.sh (revision 1584) @@ -54,9 +54,7 @@ else # Append messages to the log as passed by other scripts. if [ "${verboseText}" = "LineBreak" ]; then - echo " -====================================================== -" >>"${logFile}" + echo "======================================================" >>"${logFile}" fi if [[ "${verboseText}" == *fdisk* ]]; then