␉echo "*** Cannot find the volume. Exiting."␊ |
␉"$scriptDir"InstallLog.sh "${installerVolume}" "FAIL: Cannot file the volume: $targetVolume."␊ |
␉exit 1␊ |
else␊ |
␉echo "Confirming target volume exists"␊ |
#else␊ |
␉#echo "DEBUG: Confirming target volume exists"␊ |
fi␊ |
␊ |
␊ |
|
␉echo "*** ERROR Volume does not use slices. Exiting."␊ |
␉"$scriptDir"InstallLog.sh "${installerVolume}" "FAIL: $targetVolume doesn't use slices."␊ |
␉exit 1␉␉␊ |
else␊ |
␉echo "Confirming target device uses slices"␊ |
#else␊ |
␉#echo "DEBUG: Confirming target device uses slices"␊ |
fi␊ |
␊ |
␊ |
|
␉␉stripped=$( echo ${stripped%s*})"s1"␊ |
␉fi␊ |
␉if [ ! $( diskutil list | grep ${stripped} | awk {'print $2'} ) = "EFI" ]; then␊ |
␉␉echo "*** The selected volume doesn't have an EFI System Partition. Exiting."␊ |
␉␉#echo "DEBUG: *** The selected volume doesn't have an EFI System Partition. Exiting."␊ |
␉␉"$scriptDir"InstallLog.sh "${installerVolume}" "FAIL: Selected disk does not have an EFI System Partition."␊ |
␉␉exit 1␊ |
␉fi␊ |
|
␊ |
# Check for existing Chameleon installations on a different␊ |
# partition of the same target disk.␊ |
echo "Checking for existing Chameleon installations on ${targetDisk#/dev/}..."␊ |
#echo "DEBUG: Checking for existing Chameleon installations on ${targetDisk#/dev/}..."␊ |
␊ |
sliceNumber=$( echo ${targetDeviceRaw#*disk*s} )␊ |
# strip slice from end␊ |
|
␉␉# Check for existing stage 0 boot file from CheckDiskMicrocode.sh script␊ |
␉␉stage0type=$( dd 2>/dev/null if="$targetDisk" count=3 bs=1 skip=105 | xxd | awk '{print $2$3}' )␊ |
␉␉if [ "${stage0type}" == "0b807c" ] || [ "${stage0type}" == "0a803c" ] || [ "${stage0type}" == "ee7505" ]; then␊ |
␉␉␉echo "boot0 found on $targetDisk"␊ |
␉␉␉#echo "DEBUG: boot0 found on $targetDisk"␊ |
␉␉␉(( stageExistence++ ))␊ |
␉␉fi␊ |
␉␉␉␊ |
␉␉# Check for boot1h and boot1f32␊ |
␉␉boot1hSearch=$( dd 2>/dev/null if="$targetDiskRaw" count=1 | perl -ne '@a=split"";for(@a){printf"%02x",ord}' )␊ |
␉␉if [ "${boot1hSearch:0:16}" == "fa31c08ed0bcf0ff" ]; then␊ |
␉␉␉echo "boot1h found on "$targetDiskRaw␊ |
␉␉␉#echo "DEBUG: boot1h found on "$targetDiskRaw␊ |
␉␉␉(( stageExistence++ ))␊ |
␉␉elif [ "${boot1hSearch:0:4}" == "e962" ] && [ "${boot1hSearch:180:12}" == "424f4f542020" ]; then␊ |
␉␉␉echo "boot1f32 found on "$targetDiskRaw␊ |
␉␉␉#echo "DEBUG: boot1f32 found on "$targetDiskRaw␊ |
␉␉␉(( stageExistence++ ))␊ |
␉␉fi␊ |
␉␉␊ |
␉␉# Check for existing stage 2 boot file also␊ |
␉␉if [ -e "$( df | grep $targetDisk"s"$i | awk '{ print $6 }' )"/boot ]; then␊ |
␉␉␉echo "boot found on $targetDiskRaw"␊ |
␉␉␉#echo "DEBUG: boot found on $targetDiskRaw"␊ |
␉␉␉(( stageExistence++ ))␊ |
␉␉fi␊ |
␉␉␊ |
␉␉if [ $stageExistence == 3 ] && [ $i -ne $sliceNumber ]; then␊ |
␉␉␉echo "STOP: Not recommended you install to $targetDeviceRaw as there is already an existing Chameleon installation on $targetDiskRaw"␊ |
␉␉␉"$scriptDir"InstallLog.sh "${installerVolume}" "STOP: Not recommended you install to $targetDeviceRaw as there is already an existing Chameleon installation on $targetDiskRaw."␊ |
␉␉␉echo "================================"␊ |
␉␉␉echo "End"␊ |
␉␉␉echo "--------------------------------"␊ |
␉␉␉#echo "DEBUG: STOP: There is already an existing Chameleon installation on $targetDiskRaw"␊ |
␉␉␉"$scriptDir"InstallLog.sh "${installerVolume}" "STOP: There is already an existing Chameleon installation on $targetDiskRaw."␊ |
␉␉␉"$scriptDir"InstallLog.sh "${installerVolume}" "STOP: You could continue to install to $targetDeviceRaw, but you will have to"␊ |
␉␉␉"$scriptDir"InstallLog.sh "${installerVolume}" "STOP: control which partition is loaded by flagging the required partition active."␊ |
␉␉␉"$scriptDir"InstallLog.sh "${installerVolume}" "STOP: For now, please proceed by installing Chameleon manually."␊ |
␉␉␉exit 1␊ |
␉␉fi␊ |
␉done␊ |
␊ |
else␊ |
␉echo "Just one slice"␊ |
#else␊ |
␉#echo "DEBUG: Just one slice"␊ |
fi␊ |
␊ |
␊ |
echo "-----------------------------------------------"␊ |
echo ""␊ |
␊ |
#"$scriptDir"InstallLog.sh "${installerVolume}" "CheckProceed: PASS"␊ |
␊ |
exit 0 |