Index: branches/blackosx/package/Scripts/Standard/postinstall =================================================================== --- branches/blackosx/package/Scripts/Standard/postinstall (revision 1541) +++ branches/blackosx/package/Scripts/Standard/postinstall (revision 1542) @@ -71,7 +71,7 @@ # Double check we can see the selected partition and it's of the right type # if not the following script returns to indicate failure. -"$scriptDir"CheckProceed.sh "${targetVolume}" "${targetDevice}" +"$scriptDir"CheckProceed.sh "${targetVolume}" "${targetVolume}" "${targetDeviceTemp}" "${scriptDir}" returnValue=$? if [ ${returnValue}=0 ]; then # OK to proceed @@ -80,7 +80,7 @@ # Does a GRUB or Linux loader already exist in the disk's MBR? # The script returns 1 if yes, 0 if no. - "$scriptDir"CheckGRUBLinuxLoader.sh "${targetDisk}" + "$scriptDir"CheckGRUBLinuxLoader.sh "${targetDisk}" "${targetVolume}" "${scriptDir}" returnValue=$? if [ ${returnValue} = 0 ]; then # OK to proceed @@ -133,6 +133,7 @@ if [ "${fatType}" = 1 ] && [ "${partitionTable}" = 3 ]; then echo "ERROR: - Can't install to a device using FAT16" # Write error to Chameleon_Error_Log file + "$scriptDir"InstallLog.sh "${targetVolume}" "Cannot install to a device using FAT16" else # Continue if the selected device is not a FAT16 format device Index: branches/blackosx/package/Scripts/EFI/postinstall =================================================================== --- branches/blackosx/package/Scripts/EFI/postinstall (revision 1541) +++ branches/blackosx/package/Scripts/EFI/postinstall (revision 1542) @@ -79,7 +79,7 @@ # Double check we can see the selected partition and it's of the right type - "$scriptDir"CheckProceed.sh "${targetVolumeTemp}" "${targetDeviceTemp}" + "$scriptDir"CheckProceed.sh "${targetVolumeTemp}" "${targetVolume}" "${targetDeviceTemp}" "${scriptDir}" returnValue=$? if [ ${returnValue} = 0 ]; then # OK to proceed @@ -88,7 +88,7 @@ # Does a GRUB or Linux loader already exist in the disk's MBR? # The script returns 1 if yes, 0 if no. - "$scriptDir"CheckGRUBLinuxLoader.sh "${targetDisk}" + "$scriptDir"CheckGRUBLinuxLoader.sh "${targetDisk}" "${targetVolumeTemp}" "${scriptDir}" returnValue=$? if [ ${returnValue} = 0 ]; then # OK to proceed @@ -129,7 +129,7 @@ # the following script returns 0 if it succeeds # the following script returns 1 if it fails to un-mount any EFI volume - "$scriptDir"UnMountEFIvolumes.sh + "$scriptDir"UnMountEFIvolumes.sh "${targetVolumeTemp}" "${scriptDir}" returnValue=$? if [ ${returnValue} = 0 ]; then # OK to proceed Index: branches/blackosx/package/Scripts/Install/CheckProceed.sh =================================================================== --- branches/blackosx/package/Scripts/Install/CheckProceed.sh (revision 1541) +++ branches/blackosx/package/Scripts/Install/CheckProceed.sh (revision 1542) @@ -4,34 +4,56 @@ echo "Check Proceed: Can the script continue?" echo "***************************************" -# Receives targetVolume and targetDevice # Checks the selected volume is present and the disk # is partitioned. -if [ "$#" -eq 2 ]; then - targetVolume="$1" - targetDevice="$2" +# Receives targetVolumeTemp: Stores original target if EFI install selected. +# Receives targetVolume: Stores '/Volumes/EFI' if EFI install, or blank if not. +# Receives targetDevice: Stores device number: for example /dev/disk2s1. +# Receives scriptDir: The location of the main script dir. + +if [ "$#" -eq 4 ]; then + targetVolumeTemp="$1" + targetVolume="$2" + targetDevice="$3" + scriptDir="$4" + echo "DEBUG: passed argument for targetVolumeTemp = $targetVolumeTemp" echo "DEBUG: passed argument for targetVolume = $targetVolume" echo "DEBUG: passed argument for targetDevice = $targetDevice" + echo "DEBUG: passed argument for scriptDir = $scriptDir" else echo "Error - wrong number of values passed" exit 9 fi if [ -z "$targetVolume" ]; then - echo "Cannot find the volume. Exiting." + echo "*** Cannot find the volume. Exiting." + "$scriptDir"InstallLog.sh "${targetVolumeTemp}" "Cannot file the volume." exit 1 else echo "Confirming target volume exists" fi if [ "$targetDevice" = "$targetDevice#*disk*s" ]; then - echo "ERROR Volume does not use slices." + echo "*** ERROR Volume does not use slices. Exiting." + "$scriptDir"InstallLog.sh "${targetVolumeTemp}" "The selected volume doesn't use slices." exit 1 else echo "Confirming target device uses slices" fi +# 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 + existESP=$( df | grep /dev/disk2s1 | awk {'print $6'} ) + if [ ! "$existESP" = "/Volumes/EFI" ]; then + echo "*** The selected volume doesn't have an EFI System Partition. Exiting." + "$scriptDir"InstallLog.sh "${targetVolumeTemp}" "The selected volume doesn't have an EFI System Partition." + exit 1 + fi +fi + echo "-----------------------------------------------" echo "" Index: branches/blackosx/package/Scripts/Install/CheckGRUBLinuxLoader.sh =================================================================== --- branches/blackosx/package/Scripts/Install/CheckGRUBLinuxLoader.sh (revision 1541) +++ branches/blackosx/package/Scripts/Install/CheckGRUBLinuxLoader.sh (revision 1542) @@ -4,14 +4,21 @@ echo "CheckGRUBLinuxLoader: Does GRUB or LILO exist?" echo "**********************************************" -# This script is passed the targetdisk -# it then reads the MBR of the disk in the attempt to find the +# This reads the MBR of the disk in the attempt to find the # signature for either the GRUB or Linux bootloaders. # The script returns 1 if either is found, or 0 if none found. -if [ "$#" -eq 1 ]; then +# Receives targetdisk: Stores device number: for example /dev/disk2 +# Receives targetVolumeTemp: Stores original target if EFI install selected. +# Receives scriptDir: The location of the main script dir. + +if [ "$#" -eq 3 ]; then targetDisk="$1" + targetVolumeTemp="$2" + scriptDir="$3" echo "DEBUG: passed argument for targetDisk = $targetDisk" + echo "DEBUG: passed argument for targetVolumeTemp = $targetVolumeTemp" + echo "DEBUG: passed argument for scriptDir = $scriptDir" else echo "Error - wrong number of values passed" exit 9 @@ -29,6 +36,7 @@ diskmicrocodetypeid=${diskmicrocodetype[${diskmicrocodetypecounter}]#*,} if [ ! "${diskmicrocode}" = "${diskmicrocode/${diskmicrocodetypeid}/}" ]; then echo "${diskmicrocodetype[${diskmicrocodetypecounter}]%,*} found." + "$scriptDir"InstallLog.sh "${targetVolumeTemp}" "Found an exisitng GRUB/LILO bootloader." exit 1 else echo "Didn't find a match for ${diskmicrocodetype[${diskmicrocodetypecounter}]%,*}" Index: branches/blackosx/package/Scripts/Install/UnMountEFIvolumes.sh =================================================================== --- branches/blackosx/package/Scripts/Install/UnMountEFIvolumes.sh (revision 1541) +++ branches/blackosx/package/Scripts/Install/UnMountEFIvolumes.sh (revision 1542) @@ -6,6 +6,20 @@ # loop through and un-mount ALL mounted EFI system partitions - Thanks kizwan +# Receives scriptDir: The location of the main script dir. +# Receives targetVolumeTemp: Stores original target if EFI install selected. + +if [ "$#" -eq 2 ]; then + targetVolumeTemp="$1" + scriptDir="$2" + echo "DEBUG: passed argument for targetVolumeTemp = $targetVolumeTemp" + echo "DEBUG: passed argument for scriptDir = $scriptDir" +else + echo "Error - wrong number of values passed" + exit 9 +fi + + attempts=1 while [ "$( df | grep EFI )" ] && [ "${attempts}" -lt 5 ]; do echo "Unmounting $( df | grep EFI | awk '{print $1}' )" @@ -15,6 +29,7 @@ if [ ${attempts} = 5 ]; then echo "failed to unmount EFI System Partition." echo "-----------------------------------------------" + "$scriptDir"InstallLog.sh "${targetVolumeTemp}" "Failed to unmount EFI System Partition." echo "" echo "" echo ""