Index: branches/blackosx/package/Scripts/Standard/postinstall =================================================================== --- branches/blackosx/package/Scripts/Standard/postinstall (revision 1552) +++ branches/blackosx/package/Scripts/Standard/postinstall (revision 1553) @@ -92,7 +92,7 @@ # check for a 4-byte Windows disk signature in the disk's MBR. # the following script returns 1 if a Windows disk signature exists, and 0 if not. - "$scriptDir"CheckWindowsDiskSignature.sh "${targetDisk}" + "$scriptDir"CheckWindowsDiskSignature.sh "${targetDisk}" "${targetVolume}" "${scriptDir}" diskSigCheck=$? @@ -110,7 +110,7 @@ # the following script returns 2 if MSDOS # the following script returns 0 if nothing - "$scriptDir"CheckFormat.sh "${targetDevice}" + "$scriptDir"CheckFormat.sh "${targetDevice}" "${targetVolume}" "${scriptDir}" espformat=$? @@ -120,7 +120,7 @@ # the following script returns 3 if MBR # the following script returns 0 if nothing - "$scriptDir"CheckPartitionScheme.sh "${targetDisk}" + "$scriptDir"CheckPartitionScheme.sh "${targetDisk}" "${targetVolume}" "${scriptDir}" partitionTable=$? if [ ${partitionTable} = 3 ]; then # If MBR partition scheme then check for FAT16 or FAT32 @@ -129,7 +129,7 @@ # the following script returns 2 if FAT32 # the following script returns 0 if nothing - "$scriptDir"CheckFatType.sh "${targetDeviceRaw}" + "$scriptDir"CheckFatType.sh "${targetDeviceRaw}" "${targetVolume}" "${scriptDir}" fatType=$? fi Index: branches/blackosx/package/Scripts/EFI/postinstall =================================================================== --- branches/blackosx/package/Scripts/EFI/postinstall (revision 1552) +++ branches/blackosx/package/Scripts/EFI/postinstall (revision 1553) @@ -103,7 +103,7 @@ # check for a 4-byte Windows disk signature in the disk's MBR. # the following script returns 1 if a Windows disk signature exists, and 0 if not. - "$scriptDir"CheckWindowsDiskSignature.sh "${targetDisk}" + "$scriptDir"CheckWindowsDiskSignature.sh "${targetDisk}" "${targetVolumeChosenByUser}" "${scriptDir}" diskSigCheck=$? @@ -121,14 +121,14 @@ # the following script returns 2 if MSDOS # the following script returns 0 if nothing - **** the script shouldn't continue here??? as the partition is not formatted as either HFS or msdos??? **** - "$scriptDir"CheckFormat.sh "${targetDevice}" + "$scriptDir"CheckFormat.sh "${targetDevice}" "${targetVolumeChosenByUser}" "${scriptDir}" espformat=$? # Determine the partition scheme of the selected disk # is it GPT or a hybrid GPT/MBR - "$scriptDir"CheckPartitionScheme.sh "${targetDisk}" + "$scriptDir"CheckPartitionScheme.sh "${targetDisk}" "${targetVolumeChosenByUser}" "${scriptDir}" # Unmount ALL mounted volumes named EFI Index: branches/blackosx/package/Scripts/Install/CheckFormat.sh =================================================================== --- branches/blackosx/package/Scripts/Install/CheckFormat.sh (revision 1552) +++ branches/blackosx/package/Scripts/Install/CheckFormat.sh (revision 1553) @@ -4,15 +4,22 @@ echo "CheckFormat: Is target HFS or MSDOS?" echo "**********************************************" -# Receives passed value for the Target Volume Device -# for example: /dev/disk0s2 # if the selected partition is formatted as HFS then exit with 1 # if the selected partition is formatted as MSDOS then exit with 2 # if fstyp doesn't return a value then exit with 0 -if [ "$#" -eq 1 ]; then +# Receives targetDevice: for example, /dev/disk0s2 +# Receives targetVolume: Volume to install to. +# Receives scriptDir: The location of the main script dir. + + +if [ "$#" -eq 3 ]; then targetDevice="$1" + targetVolume="$2" + scriptDir="$3" echo "DEBUG: passed argument for targetDevice = $targetDevice" + echo "DEBUG: passed argument for targetVolume = $targetVolume" + echo "DEBUG: passed argument for scriptDir = $scriptDir" else echo "Error - wrong number of values passed" exit 9 @@ -22,6 +29,7 @@ echo "${targetDevice} is currently formatted as HFS" echo "-----------------------------------------------" echo "" + "$scriptDir"InstallLog.sh "${targetVolume}" "${targetDevice} is currently formatted as HFS" exit 1 fi @@ -29,6 +37,7 @@ echo "${targetDevice} is currently formatted as msdos" echo "-----------------------------------------------" echo "" + "$scriptDir"InstallLog.sh "${targetVolume}" "${targetDevice} is currently formatted as msdos" exit 2 fi @@ -36,4 +45,6 @@ echo "-----------------------------------------------" echo "" +"$scriptDir"InstallLog.sh "${targetVolume}" "WARNING: ${targetDevice} is currently not formatted as either HFS or msdos" + exit 0 \ No newline at end of file Index: branches/blackosx/package/Scripts/Install/CheckFatType.sh =================================================================== --- branches/blackosx/package/Scripts/Install/CheckFatType.sh (revision 1552) +++ branches/blackosx/package/Scripts/Install/CheckFatType.sh (revision 1553) @@ -4,9 +4,7 @@ echo "CheckFatType: Do we have FAT16 or FAT32?" echo "****************************************" -# Receives passed value for the raw Target Device -# for example: /dev/rdisk0s2 -# Then looks for the following in the partition boot sector +# Looks for the following in the partition boot sector # Byte number 19 to see if it's either 00 or 02 # Byte number 22 to see if it's either F8 or F0 # Byte number 25 to see if it's either 3F or 20 @@ -14,9 +12,18 @@ # Exit with value 1 for FAT16, 2 for FAT32 # Exit with value 0 if nothing is found - this shouldn't happen.? -if [ "$#" -eq 1 ]; then +# Receives targetDeviceRaw: for example, /dev/rdisk0s2. +# Receives targetVolume: Volume to install to. +# Receives scriptDir: The location of the main script dir. + + +if [ "$#" -eq 3 ]; then targetDeviceRaw="$1" + targetVolume="$2" + scriptDir="$3" echo "DEBUG: passed argument = $targetDeviceRaw" + echo "DEBUG: passed argument for targetVolume = $targetVolume" + echo "DEBUG: passed argument for scriptDir = $scriptDir" else echo "Error - wrong number of values passed" exit 9 @@ -28,36 +35,42 @@ echo "Found a FAT32 device formatted by Windows Explorer" echo "--------------------------------------------------" echo "" + "$scriptDir"InstallLog.sh "${targetVolume}" "${targetDeviceRaw} is on a FAT32 volume formatted by Windows Explorer" exit 2 fi if [ "${partitionBootSector:36:2}" == "02" ] && [ "${partitionBootSector:42:2}" == "f8" ] && [ "${partitionBootSector:48:2}" == "3f" ]; then echo "Found a FAT16 device formatted by Windows Explorer" echo "--------------------------------------------------" echo "" + "$scriptDir"InstallLog.sh "${targetVolume}" "${targetDeviceRaw} is on a FAT16 volume formatted by Windows Explorer" exit 1 fi if [ "${partitionBootSector:36:2}" == "00" ] && [ "${partitionBootSector:42:2}" == "f0" ] && [ "${partitionBootSector:48:2}" == "20" ]; then echo "Found a FAT32 device formatted by OS X Snow Leopard Disk Utility" echo "----------------------------------------------------------------" echo "" + "$scriptDir"InstallLog.sh "${targetVolume}" "${targetDeviceRaw} is on a FAT32 volume formatted by OS X Snow Leopard Disk Utility" exit 2 fi if [ "${partitionBootSector:36:2}" == "02" ] && [ "${partitionBootSector:42:2}" == "f0" ] && [ "${partitionBootSector:48:2}" == "20" ]; then echo "Found a FAT16 device formatted by OS X Snow Leopard Disk Utility" echo "----------------------------------------------------------------" echo "" + "$scriptDir"InstallLog.sh "${targetVolume}" "${targetDeviceRaw} is on a FAT16 volume formatted by OS X Snow Leopard Disk Utility" exit 1 fi if [ "${partitionBootSector:36:2}" == "00" ] && [ "${partitionBootSector:42:2}" == "f8" ] && [ "${partitionBootSector:48:2}" == "20" ]; then echo "Found a FAT32 device formatted by OS X Lion Disk Utility" echo "--------------------------------------------------------" echo "" + "$scriptDir"InstallLog.sh "${targetVolume}" "${targetDeviceRaw} is on a FAT32 volume formatted by OS X Lion Disk Utility" exit 2 fi if [ "${partitionBootSector:36:2}" == "02" ] && [ "${partitionBootSector:42:2}" == "f8" ] && [ "${partitionBootSector:48:2}" == "20" ]; then echo "Found a FAT16 device formatted by OS X Lion Disk Utility" echo "--------------------------------------------------------" echo "" + "$scriptDir"InstallLog.sh "${targetVolume}" "${targetDeviceRaw} is on a FAT16 volume formatted by OS X Lion Disk Utility" exit 1 fi echo "-----------------------------------------------" Index: branches/blackosx/package/Scripts/Install/CheckPartitionScheme.sh =================================================================== --- branches/blackosx/package/Scripts/Install/CheckPartitionScheme.sh (revision 1552) +++ branches/blackosx/package/Scripts/Install/CheckPartitionScheme.sh (revision 1553) @@ -4,19 +4,25 @@ echo "Check the Partition Scheme: GPT, GPT/MBR or MBR?" echo "************************************************" -# Receives passed value for the Target Disk -# for example: /dev/disk0s2 -# Then looks for the following: -# First 8 bytes of the GPTdiskGPTHeader to identify a GUID partition table. +# Looks for the first 8 bytes of the GPTdiskGPTHeader to identify a GUID partition table. # Byte number 450 of the GPTdiskProtectiveMBR to identify ID of 'EE' to identify a GPT partition. # Byte numbers 466, 482 & 498 of the GPTdiskProtectiveMBR to identify further partitions. # # Exit with value 1 for GPT, 2 for GPT/MBR and 3 for MBR. # Exit with value 0 if nothing is found - this shouldn't happen.? -if [ "$#" -eq 1 ]; then +# Receives targetDisk: for example, /dev/disk0s2 +# Receives targetVolume: Volume to install to. +# Receives scriptDir: The location of the main script dir. + + +if [ "$#" -eq 3 ]; then targetDisk="$1" + targetVolume="$2" + scriptDir="$3" echo "DEBUG: passed argument = $targetDisk" + echo "DEBUG: passed argument for targetVolume = $targetVolume" + echo "DEBUG: passed argument for scriptDir = $scriptDir" else echo "Error - wrong number of values passed" exit 9 @@ -34,12 +40,14 @@ echo "${partitiontable} found." echo "-----------------------------------------------" echo "" + "$scriptDir"InstallLog.sh "${targetVolume}" "Identified ${targetDisk} is on a volume using a GPT." exit 1 else partitiontable="GPT/MBR" echo "${partitiontable} found." echo "-----------------------------------------------" echo "" + "$scriptDir"InstallLog.sh "${targetVolume}" "Identified ${targetDisk} is on a volume using a GPT/MBR." exit 2 fi fi @@ -48,10 +56,14 @@ echo "${partitiontable} found." echo "-----------------------------------------------" echo "" + "$scriptDir"InstallLog.sh "${targetVolume}" "Identified ${targetDisk} is on a volume using MBR." exit 3 fi echo "No partition table found." echo "-----------------------------------------------" echo "" + +"$scriptDir"InstallLog.sh "${targetVolume}" "NOTE: No partition table found." + exit 0 \ No newline at end of file Index: branches/blackosx/package/Scripts/Install/CheckDiskMicrocode.sh =================================================================== --- branches/blackosx/package/Scripts/Install/CheckDiskMicrocode.sh (revision 1552) +++ branches/blackosx/package/Scripts/Install/CheckDiskMicrocode.sh (revision 1553) @@ -41,6 +41,7 @@ if [ $( echo "${mbr437}" | awk -F0 '{print NF-1}' ) = 874 ]; then echo "The first 437 bytes of the MBR Disk Sector is blank - Updating" + "$scriptDir"InstallLog.sh "${targetVolume}" "First 437 bytes of the MBR are currently blank. Will update." else # There is already something on the MBR @@ -49,6 +50,7 @@ windowsloader=$( dd 2>/dev/null if="$targetDisk" count=4 bs=1 | xxd | awk '{print $2$3}' ) if [ "${windowsloader}" == "33c08ed0" ] ; then echo "Found existing Windows Boot Loader so will replace with Chameleon Boot0hfs" + "$scriptDir"InstallLog.sh "${targetVolume}" "Found existing Windows boot loader - Will replace with boot0hfs" fi # See if a Chameleon stage0 boot file already exists @@ -61,20 +63,24 @@ #echo ${stage0type} if [ "${stage0type}" == "0b807c" ]; then echo "Found existing Chameleon stage 0 loader - Boot0hfs" + "$scriptDir"InstallLog.sh "${targetVolume}" "Found existing Chameleon stage 0 loader - boot0hfs" # Script CheckDiskSignature.sh returned 0 if a Windows installation was NOT found if [ "$diskSigCheck" == "0" ]; then echo "Found no existing Windows installation so will replace stage 0 loader with Boot0" + "$scriptDir"InstallLog.sh "${targetVolume}" "Windows is not installed - Replace boot0hfs with boot0" exit 0 fi fi if [ "${stage0type}" == "0a803c" ]; then echo "Found existing Chameleon stage 0 loader - Boot0" + "$scriptDir"InstallLog.sh "${targetVolume}" "Found existing Chameleon stage 0 loader - boot0" # Script CheckDiskSignature.sh returned 1 if a Windows installation was found if [ "$diskSigCheck" = "1" ]; then echo "Found existing Windows installation so will replace stage 0 loader with Boot0hfs" + "$scriptDir"InstallLog.sh "${targetVolume}" "As Windows is installed - Replace boot0 with boot0hfs" exit 0 fi fi @@ -82,6 +88,7 @@ if [ "${stage0type}" == "ee7505" ]; then echo "Found existing Chameleon stage 0 loader - Boot0md" echo "And will leave boot0md installed." + "$scriptDir"InstallLog.sh "${targetVolume}" "Found existing Chameleon stage 0 loader - boot0md. Leaving as is." exit 1 fi @@ -91,7 +98,7 @@ echo "Disk microcode found: ${test} - Preserving." echo "diskupdate is set to false" echo "-----------------------------------------------" - "$scriptDir"InstallLog.sh "${targetVolume}" "NOTE: Found existing unknown bootcode in the MBR" + "$scriptDir"InstallLog.sh "${targetVolume}" "NOTE: Found existing unknown bootcode in the MBR. Leaving as is." echo "" exit 1 fi Index: branches/blackosx/package/Scripts/Install/CheckProceed.sh =================================================================== --- branches/blackosx/package/Scripts/Install/CheckProceed.sh (revision 1552) +++ branches/blackosx/package/Scripts/Install/CheckProceed.sh (revision 1553) @@ -48,7 +48,7 @@ existESP=$( df | grep $targetDevice | awk {'print $6'} ) if [ ! "$existESP" = "/Volumes/EFI" ]; then echo "*** The selected volume doesn't have an EFI System Partition. Exiting." - "$scriptDir"InstallLog.sh "${installerVolume}" "FAIL: $installerVolume doesn't have an EFI System Partition." + "$scriptDir"InstallLog.sh "${installerVolume}" "FAIL: Target disk doesn't have an EFI System Partition." exit 1 fi fi Index: branches/blackosx/package/Scripts/Install/CheckGRUBLinuxLoader.sh =================================================================== --- branches/blackosx/package/Scripts/Install/CheckGRUBLinuxLoader.sh (revision 1552) +++ branches/blackosx/package/Scripts/Install/CheckGRUBLinuxLoader.sh (revision 1553) @@ -36,7 +36,7 @@ diskmicrocodetypeid=${diskmicrocodetype[${diskmicrocodetypecounter}]#*,} if [ ! "${diskmicrocode}" = "${diskmicrocode/${diskmicrocodetypeid}/}" ]; then echo "${diskmicrocodetype[${diskmicrocodetypecounter}]%,*} found." - "$scriptDir"InstallLog.sh "${targetVolume}" "FAIL: Found an exisitng GRUB/LILO bootloader." + "$scriptDir"InstallLog.sh "${targetVolume}" "FAIL: Found an exisitng GRUB/LILO bootloader in the MBR." exit 1 else echo "Didn't find a match for ${diskmicrocodetype[${diskmicrocodetypecounter}]%,*}" @@ -45,4 +45,6 @@ echo "-----------------------------------------------" echo "" +"$scriptDir"InstallLog.sh "${targetVolume}" "GRUB/LILO: PASS" + exit 0 \ No newline at end of file Index: branches/blackosx/package/Scripts/Install/CheckWindowsDiskSignature.sh =================================================================== --- branches/blackosx/package/Scripts/Install/CheckWindowsDiskSignature.sh (revision 1552) +++ branches/blackosx/package/Scripts/Install/CheckWindowsDiskSignature.sh (revision 1553) @@ -8,11 +8,16 @@ # if one is found then it exits with 1, otherwise it exits with 0 # Receives targetdisk: for example, /dev/disk0 +# Receives targetVolume: Volume to install to. +# Receives scriptDir: The location of the main script dir. - -if [ "$#" -eq 1 ]; then +if [ "$#" -eq 3 ]; then targetDisk="$1" + targetVolume="$2" + scriptDir="$3" echo "DEBUG: passed argument for targetDisk = $targetDisk" + echo "DEBUG: passed argument for targetVolume = $targetVolume" + echo "DEBUG: passed argument for scriptDir = $scriptDir" else echo "Error - wrong number of values passed - Exiting" exit 9 @@ -26,11 +31,13 @@ echo "No Windows installation detected." echo "-----------------------------------------------" echo "" + "$scriptDir"InstallLog.sh "${targetVolume}" "Windows is not installed on this volume." exit 0 else echo "Detected an existing Windows installation" echo "-----------------------------------------------" echo "" + "$scriptDir"InstallLog.sh "${targetVolume}" "Detected a Windows installation on this volume." exit 1 fi