Chameleon

Chameleon Commit Details

Date:2011-11-01 08:57:41 (12 years 5 months ago)
Author:blackosx
Commit:1684
Parents: 1683
Message:Update CheckPreviousChameleon script to use the same code for corrupting a boot sector regardless of format.
Changes:
M/trunk/package/Scripts/Sub/CheckPreviousChameleon.sh

File differences

trunk/package/Scripts/Sub/CheckPreviousChameleon.sh
131131
132132
133133
134
135
134
136135
137136
138137
......
149148
150149
151150
152
153
154
155
156
157
158
159
160
161
162
163
164
165
151
152
153
154
155
156
166157
167158
168159
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

Archive Download the corresponding diff file

Revision: 1684