␉␉␉␉␉if [ $i -lt $sliceNumber ]; then␊ |
␉␉␉␉␉␉"$scriptDir"InstallLog.sh "${installerVolume}" "WARN: Conditions point to the possibility of a boot failure"␊ |
␊ |
␉␉␉␉␉␉# Fix by making previous paritionboot sector un-bootable␊ |
␉␉␉␉␉␉# Change Byte 01FExh to 00 (510 decimal)␉␉␊ |
␉␉␉␉␉␉# Fix by making previous parition bootsector un-bootable␉␊ |
␉␉␉␉␉␉message="---␊ |
FIX: Make ${targetDisk}s${i} boot sector un-bootable by changing byte 1FEh to 00.␊ |
NOTE: Any Extra folder you had there will still be there. If you want to use␊ |
|
␉␉␉␉␉␉␉diskutil unmount "${targetDisk}"s${i}␊ |
␉␉␉␉␉␉fi␊ |
␉␉␉␉␉␉␉␉␉␉␉␉␊ |
␉␉␉␉␉␉if [ "$( fstyp "${targetDisk}"s${i} | grep hfs )" ]; then␊ |
␉␉␉␉␉␉␉#echo "DEBUG: HFS - changing byte 1FEh to 00"␊ |
␉␉␉␉␉␉␉dd if=${targetDisk}s${i} count=2 bs=512 of=originalBootSector␊ |
␉␉␉␉␉␉␉cp originalBootSector newBootSector␊ |
␉␉␉␉␉␉␉dd if="patch" of=newBootSector bs=1 count=1 seek=510 conv=notrunc␊ |
␉␉␉␉␉␉␉dd if=newBootSector of=${targetDisk}s${i} count=2 bs=510␊ |
␉␉␉␉␉␉fi␊ |
␉␉␉␉␉␉if [ "$( fstyp "${targetDisk}"s${i} | grep msdos )" ]; then␊ |
␉␉␉␉␉␉␉#echo "DEBUG: MSDOS - changing byte 1FEh to 00"␊ |
␉␉␉␉␉␉␉dd if=${targetDisk}s${i} count=1 bs=512 of=/tmp/originalBootSector␊ |
␉␉␉␉␉␉␉cp /tmp/originalBootSector /tmp/newBootSector␊ |
␉␉␉␉␉␉␉dd if="$scriptDir/patch" of=/tmp/newBootSector bs=1 count=1 seek=510 conv=notrunc␊ |
␉␉␉␉␉␉␉dd if=/tmp/newBootSector of=${targetDisk}s${i} count=1 bs=512␊ |
␉␉␉␉␉␉fi␊ |
␉␉␉␉␉␉# Change Byte 01FExh to 00 (510 decimal)␊ |
␉␉␉␉␉␉# Same code can be used for HFS or FAT32␊ |
␉␉␉␉␉␉dd if=${targetDisk}s${i} count=1 bs=512 of=/tmp/originalBootSector␊ |
␉␉␉␉␉␉cp /tmp/originalBootSector /tmp/newBootSector␊ |
␉␉␉␉␉␉dd if="$scriptDir/patch" of=/tmp/newBootSector bs=1 count=1 seek=510 conv=notrunc␊ |
␉␉␉␉␉␉dd if=/tmp/newBootSector of=${targetDisk}s${i} count=1 bs=512␊ |
␉␉␉␉␉␉␊ |
␉␉␉␉␉␉# /Volumes/EFI needs re-mounting so EFI/postinstall script can use it.␊ |
␉␉␉␉␉␉# Don't check for a GPT as wouldn't have got here if it wasn't␊ |