Index: branches/blackosx/package/Scripts/Main/ESPpostinstall =================================================================== --- branches/blackosx/package/Scripts/Main/ESPpostinstall (revision 1744) +++ branches/blackosx/package/Scripts/Main/ESPpostinstall (revision 1745) @@ -103,7 +103,7 @@ # OK to proceed # Remember if the target volume has an EFI system partition. - if [ ${returnValue} -ne 0 ]; then + if [ ${returnValue} -ne 1 ]; then efiPartitionExist=1 fi @@ -169,6 +169,8 @@ "$scriptDir"WriteChameleonStage2.sh "${stage2Loader}" "${targetVolume}" "${targetDevice}" "${targetVolumeChosenByUser}" "${scriptDir}" # Check for another existing Chameleon installation on the same disk + "$scriptDir"InstallLog.sh "${targetVolume}" "LineBreak" + "$scriptDir"InstallLog.sh "${targetVolume}" "About to check target disk for previous installations." "$scriptDir"CheckPreviousChameleon.sh "${targetDisk}" "${targetDeviceRaw}" "${targetDevice}" "${targetVolumeChosenByUser}" "${scriptDir}" fi Index: branches/blackosx/package/Scripts/Main/Standardpostinstall =================================================================== --- branches/blackosx/package/Scripts/Main/Standardpostinstall (revision 1744) +++ branches/blackosx/package/Scripts/Main/Standardpostinstall (revision 1745) @@ -91,7 +91,7 @@ # OK to proceed # Remember if the target volume has an EFI system partition. - if [ ${returnValue} -ne 0 ]; then + if [ ${returnValue} -ne 1 ]; then efiPartitionExist=1 fi @@ -168,32 +168,21 @@ # Write the stage 2 loader to the root of the selected partition "$scriptDir"WriteChameleonStage2.sh "${stage2Loader}" "${3}" "${targetDevice}" "${targetVolume}" "${scriptDir}" - # Next we look to check for existing Chameleon installations. - # But as it will check /Volumes/EFI for the stage 2 loader, - # we need to make sure it's mounted. - - # Tell the user what's going on. "$scriptDir"InstallLog.sh "${targetVolume}" "LineBreak" - "$scriptDir"InstallLog.sh "${targetVolume}" "About to check your disk for previous installations" - "$scriptDir"InstallLog.sh "${targetVolume}" "which involves checking the EFI system partition if" - "$scriptDir"InstallLog.sh "${targetVolume}" "appropriate for this disk." - - # Unmount ALL mounted volumes named EFI. - # Returns 0=success, 1=fail - "$scriptDir"UnMountEFIvolumes.sh "${targetVolume}" "${scriptDir}" - returnValue=$? - if [ ${returnValue} = 0 ]; then - # OK to proceed - - if [ ${partitionScheme} = 1 ] || [ ${partitionScheme} = 2 ]; then + "$scriptDir"InstallLog.sh "${targetVolume}" "About to check target disk for previous installations." + if [ ${efiPartitionExist} -ne 0 ]; then # volume has an EFI system partition + "$scriptDir"InstallLog.sh "${targetVolume}" "Going to check the EFI system partition also." + # Unmount ALL mounted volumes named EFI. Returns 0=success, 1=fail + "$scriptDir"UnMountEFIvolumes.sh "${targetVolume}" "${scriptDir}" + returnValue=$? + if [ ${returnValue} = 0 ]; then # Mount the EFI system partition "$scriptDir"MountESP.sh "${targetDisk}" "${targetVolume}" "${efiPartitionExist}" "${scriptDir}" fi - - # Check for another existing Chameleon installation on the same disk - "$scriptDir"CheckPreviousChameleon.sh "${targetDisk}" "${targetDeviceRaw}" "${targetDevice}" "${targetVolume}" "${scriptDir}" fi + # Check for another existing Chameleon installation on the same disk + "$scriptDir"CheckPreviousChameleon.sh "${targetDisk}" "${targetDeviceRaw}" "${targetDevice}" "${targetVolume}" "${scriptDir}" # Append a line break to the installer log "$scriptDir"InstallLog.sh "${targetVolume}" "LineBreak" Index: branches/blackosx/package/Scripts/Sub/CheckPreviousChameleon.sh =================================================================== --- branches/blackosx/package/Scripts/Sub/CheckPreviousChameleon.sh (revision 1744) +++ branches/blackosx/package/Scripts/Sub/CheckPreviousChameleon.sh (revision 1745) @@ -176,8 +176,8 @@ fi done -#else - #echo "DEBUG: Just one slice" +else + "$scriptDir"InstallLog.sh "${installerVolume}" "Nothing to check as there's only one partition." fi exit 0 \ No newline at end of file Index: branches/blackosx/package/Scripts/Sub/MountESP.sh =================================================================== --- branches/blackosx/package/Scripts/Sub/MountESP.sh (revision 1744) +++ branches/blackosx/package/Scripts/Sub/MountESP.sh (revision 1745) @@ -19,7 +19,7 @@ scriptDir="$4" echo "DEBUG: passed argument for targetDisk = $targetDisk" echo "DEBUG: passed argument for installerVolume = $installerVolume" - echo "DEBUG: passed argument for installerVolume = $efiPartitionExist" + echo "DEBUG: passed argument for efiPartitionExist = $efiPartitionExist" echo "DEBUG: passed argument for scriptDir = $scriptDir" else echo "Error - wrong number of values passed" Index: branches/blackosx/package/Scripts/Sub/CheckProceed.sh =================================================================== --- branches/blackosx/package/Scripts/Sub/CheckProceed.sh (revision 1744) +++ branches/blackosx/package/Scripts/Sub/CheckProceed.sh (revision 1745) @@ -7,7 +7,7 @@ # Checks the selected volume is present and the disk is partitioned # Now also check for another existing Chameleon installation on the same disk. # Exit with 0 to indicate okay to proceed, no problems. -# Exit with 1 to indicate okay to proceed, but note target doesn't have EFI system partition. +# Exit with 1 to indicate okay to proceed, but target disk doesn't have EFI system partition. # Exit with 2 to indicate not to proceed. # Receives targetVolume: Volume to install to (will be '/Volumes/EFI' if EFI install) @@ -29,40 +29,37 @@ exit 9 fi - # Does target volume exist? if [ -z "$targetVolume" ]; then echo "*** Cannot find the volume. Exiting." "$scriptDir"InstallLog.sh "${installerVolume}" "FAIL: Cannot file the volume: $targetVolume." exit 2 -#else - #echo "DEBUG: Confirming target volume exists" fi - # Does target volume use slices? if [ "$targetDevice" = "$targetDevice#*disk*s" ]; then echo "*** ERROR Volume does not use slices. Exiting." "$scriptDir"InstallLog.sh "${installerVolume}" "FAIL: $targetVolume doesn't use slices." exit 2 -#else - #echo "DEBUG: Confirming target device uses slices" fi +# Check to find if an EFI system partition exists on the disk. +# This is used in two cases: +# A) When checking for existing Chameleon installations. +# B) When the user chooses the EFI system partition install option, +# and installing to a 'small' HFS device like a 1GB USB flash +# drive which won't have an EFI System Partition. -# Add check for installing to a 'small' HFS device like a -# 1GB USB flash drive which won't have an EFI System Partition. -if [ "$targetVolume" = "/Volumes/EFI" ]; then - # Take target device and check slice 1 matches partition named "EFI" - stripped=$( echo ${targetDevice#/dev/} ) - if [ ! $(echo ${stripped#*disk*s}) = 1 ]; then - stripped=$( echo ${stripped%s*})"s1" - fi - if [ ! $( diskutil list | grep ${stripped} | awk {'print $2'} ) = "EFI" ]; then - #echo "DEBUG: *** The selected volume doesn't have an EFI System Partition. Exiting." +# Take target device and check if slice 1 is not named "EFI" +stripped=$( echo ${targetDevice#/dev/} ) +if [ ! $(echo ${stripped#*disk*s}) = 1 ]; then + stripped=$( echo ${stripped%s*})"s1" +fi +if [ ! $( diskutil list | grep ${stripped} | awk {'print $2'} ) = "EFI" ]; then + if [ "$targetVolume" = "/Volumes/EFI" ]; then "$scriptDir"InstallLog.sh "${installerVolume}" "FAIL: Selected disk does not have an EFI System Partition." - exit 1 fi + exit 1 fi exit 0 \ No newline at end of file