Chameleon

Chameleon Commit Details

Date:2011-12-24 10:41:51 (6 years 11 months ago)
Author:blackosx
Commit:1745
Parents: 1744
Message:Revised script and installation log messaging before checking for previous Chameleon installations on the EFI system partition.
Changes:
M/branches/blackosx/package/Scripts/Main/ESPpostinstall
M/branches/blackosx/package/Scripts/Sub/CheckPreviousChameleon.sh
M/branches/blackosx/package/Scripts/Sub/MountESP.sh
M/branches/blackosx/package/Scripts/Main/Standardpostinstall
M/branches/blackosx/package/Scripts/Sub/CheckProceed.sh

File differences

branches/blackosx/package/Scripts/Main/ESPpostinstall
103103
104104
105105
106
106
107107
108108
109109
......
169169
170170
171171
172
173
172174
173175
174176
# 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
"$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
branches/blackosx/package/Scripts/Main/Standardpostinstall
9191
9292
9393
94
94
9595
9696
9797
......
168168
169169
170170
171
172171
173
174
175
176
177172
178
179
180
181
182
183
184
185
186
187
188
189
173
174
175
176
177
178
179
190180
191181
192182
193
194
195
196183
184
185
197186
198187
199188
# 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
# 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"
branches/blackosx/package/Scripts/Sub/CheckPreviousChameleon.sh
176176
177177
178178
179
180
179
180
181181
182182
183183
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
branches/blackosx/package/Scripts/Sub/MountESP.sh
1919
2020
2121
22
22
2323
2424
2525
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"
branches/blackosx/package/Scripts/Sub/CheckProceed.sh
77
88
99
10
10
1111
1212
1313
......
2929
3030
3131
32
3332
3433
3534
3635
3736
38
39
4037
4138
42
4339
4440
4541
4642
4743
48
49
5044
5145
46
47
48
49
50
51
5252
53
54
55
56
57
58
59
60
61
62
53
54
55
56
57
58
59
6360
64
6561
62
6663
6764
6865
# 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)
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

Archive Download the corresponding diff file

Revision: 1745