␉␉espformat=$?␊ |
␊ |
␊ |
|
␉␉# check the partition scheme used for the selected disk.␊ |
␉␉# the following script returns 1 if GPT␊ |
␉␉# the following script returns 2 if GPT/MBR␊ |
␉␉# the following script returns 3 if MBR␊ |
␉␉# the following script returns 0 if nothing␊ |
␊ |
␉␉"$scriptDir"CheckPartitionScheme.sh "${targetDisk}"␊ |
␉␉partitionTable=$?␊ |
␉␉if [ ${partitionTable} = 3 ]; then␊ |
␉␉␉# If MBR partition scheme then check for FAT16 or FAT32␊ |
␊ |
␉␉␉# the following script returns 1 if FAT16␊ |
␉␉␉# the following script returns 2 if FAT32␊ |
␉␉␉# the following script returns 0 if nothing␊ |
␊ |
␉␉# If diskupdate is flagged as 1 then the stage 0 loader can be written to the MBR␊ |
␉␉if [ ${diskupdate} = 1 ]; then␊ |
␉␉␉"$scriptDir"WriteChameleonStage0.sh "${diskupdate}" "${diskSigCheck}" "${stage0Loader}" "${stage0LoaderDualBoot}" "${targetDisk}" "${targetVolume}"␊ |
␉␉␉"$scriptDir"CheckFatType.sh "${targetDeviceRaw}"␊ |
␉␉␉fatType=$?␊ |
␉␉fi␊ |
␊ |
␉␉# Write the stage 1 loader to the partition boot sector␊ |
␉␉"$scriptDir"WriteChameleonStage1.sh "${espformat}" "${stage1LoaderHFS}" "${stage1LoaderFAT}" "${3}" "${targetDeviceRaw}" "${targetVolume}"␊ |
␉␉if [ ${fatType} = 1 ] && [ ${partitionTable} = 3 ]; then␊ |
␉␉␉echo "ERROR: - Can't install to a device using FAT16"␊ |
␉␉else␊ |
␉␉␉# Continue if the selected device is not a FAT16 format device␊ |
␊ |
␉␉# Write the stage 2 loader to the root of the selected partition␊ |
␉␉"$scriptDir"WriteChameleonStage2.sh "${espformat}" "${stage2Loader}" "${3}" "${targetDevice}" "${targetVolume}"␊ |
␉␉␉# If diskupdate is flagged as 1 then the stage 0 loader can be written to the MBR␊ |
␉␉␉if [ ${diskupdate} = 1 ]; then␊ |
␉␉␉␉"$scriptDir"WriteChameleonStage0.sh "${diskupdate}" "${diskSigCheck}" "${stage0Loader}" "${stage0LoaderDualBoot}" "${targetDisk}" "${targetVolume}"␊ |
␉␉␉fi␊ |
␊ |
␉␉# Set the active partition ONLY if Windows is not installed␊ |
␉␉"$scriptDir"SetActivePartition.sh "${espformat}" "${diskSigCheck}" "${targetDiskRaw}" "${targetSlice}" "${targetVolume}"␊ |
␉␉␉# Write the stage 1 loader to the partition boot sector␊ |
␉␉␉"$scriptDir"WriteChameleonStage1.sh "${espformat}" "${stage1LoaderHFS}" "${stage1LoaderFAT}" "${3}" "${targetDeviceRaw}" "${targetVolume}"␊ |
␊ |
␉␉␉# Write the stage 2 loader to the root of the selected partition␊ |
␉␉␉"$scriptDir"WriteChameleonStage2.sh "${espformat}" "${stage2Loader}" "${3}" "${targetDevice}" "${targetVolume}"␊ |
␊ |
␉␉␉# Set the active partition ONLY if Windows is not installed␊ |
␉␉␉"$scriptDir"SetActivePartition.sh "${espformat}" "${diskSigCheck}" "${targetDiskRaw}" "${targetSlice}" "${targetVolume}"␉␉␉␊ |
␉␉fi␊ |
␊ |
␉fi␊ |
fi␊ |
␊ |