Chameleon

Chameleon Commit Details

Date:2011-08-18 16:55:24 (7 years 11 months ago)
Author:Azimutz
Commit:1429
Parents: 1428
Message:EFI install fix. Still work in progress.
Changes:
M/branches/azimutz/Package/package/Scripts/EFI/postinstall

File differences

branches/azimutz/Package/package/Scripts/EFI/postinstall
6363
6464
6565
66
6766
6867
6968
......
245244
246245
247246
248
247
249248
250249
251250
......
268267
269268
270269
271
270
272271
273272
274273
275
274
276275
277276
278277
......
298297
299298
300299
301
300
302301
303302
304303
305
306
304
305
307306
308307
309308
310309
311310
312
313
311
312
313
314314
315315
316316
317317
318318
319
320319
321320
322321
323
324
325
326
327
328
329
330
331
332
322
333323
334
335
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
336352
337353
338
339
340
341
342
343
344
345
346354
347355
348356
......
364372
365373
366374
375
367376
368377
369378
......
398407
399408
400409
401
410
402411
403412
404413
......
420429
421430
422431
423
424
432
433
425434
435
426436
427437
428438
echo ""
echo ""
bootvolume="/Volumes/$bootervolumename"
bootdev=${bootdev%s*}s1
bootrdev=${bootdev/disk/rdisk}
}
}
} #Azipkg: ???
start ${3}
fi
if [ "$( fstyp ${bootdev} | grep hfs )" ]; then
echo "${bootdev} is a currently formatted as HFS"
echo "${bootdev} is currently formatted as HFS"
efiformat="hfs"
fi
if [ "$( fstyp ${bootdev} | grep msdos )" ]; then
echo "${bootdev} is currently formatted as msdos"
echo "${bootdev} is currently formatted as msdos" #Azipkg: hum... it's not really msdos, but ok...
efiformat="msdos"
fi
echo "-----------------------------------------------"
echo "Diskupdate = true, so yes"
#---------------------------------------------------------------------
# Check bytes 438-446 of the GPTdiskProtectiveMBR for a Windows Disk Signature
# If there's no Windows disk signature then we can write boot0
#---------------------------------------------------------------------
if [ ${disksignature} == "00000000" ]; then
echo "Executing command: fdisk -u -f ${diskloader} -y ${bootdisk}"
fdisk -u -f "${osxvolume}/${diskloader}" -y ${bootdisk}
echo "Executing command: fdisk -u -f "${osxvolume}/usr/standalone/i386/${diskloader}" -y ${bootdisk}"
fdisk -u -f "${osxvolume}/usr/standalone/i386/${diskloader}" -y ${bootdisk} #Azipkg
else
#---------------------------------------------------------------------
# If it exists then Windows is also installed on the HDD and we need to write boot0hfs
#---------------------------------------------------------------------
echo "Executing command: fdisk -u -f ${diskloader} -y ${bootdisk}"
fdisk -u -f "${osxvolume}/${diskloader}" -y ${bootdisk}
#Azipkg: diskloader=boot0 ??? boot0hfs/boot0md - remenber this is for GPT!!
echo "Executing command: fdisk -u -f "${osxvolume}/usr/standalone/i386/${diskloader}" -y ${bootdisk}"
fdisk -u -f "${osxvolume}/usr/standalone/i386/${diskloader}" -y ${bootdisk} #Azipkg
fi
else
echo "Diskupdate is false, so no stage 0 file was written"
fi
#echo "Executing command: dd if=${partitionloader} of=${bootrdev}"
#dd if="${osxvolume}/${partitionloader}" of=${bootrdev}
echo "Prepare Stage 1 loader"
echo "Executing command: dd if=${bootrdev} count=1 bs=512 of=/tmp/origbs"
dd if=${bootrdev} count=1 bs=512 of=/tmp/origbs
if [ ${efiformat} = "hfs" ]; then
echo "Executing command: cp ${osxvolume}/${partitionloaderhfs} /tmp/newbs"
cp "${osxvolume}/${partitionloaderhfs}" /tmp/newbs
fi
# if we have an original EFI ("FAT"), copy boot1f32 to newbs
if [ ${efiformat} = "msdos" ]; then
echo "Executing command: cp ${osxvolume}/${partitionloaderfat} /tmp/newbs"
cp "${osxvolume}/${partitionloaderfat}" /tmp/newbs
echo "Prepare Stage 1 loader"
# copy partition boot sector to origbs
echo "Executing command: dd if=${bootrdev} count=1 bs=512 of=/tmp/origbs"
dd if=${bootrdev} count=1 bs=512 of=/tmp/origbs
# copy boot1f32 to newbs
echo "Executing command: cp "${osxvolume}/usr/standalone/i386/${partitionloaderfat}" /tmp/newbs"
cp "${osxvolume}/usr/standalone/i386/${partitionloaderfat}" /tmp/newbs
# "merge" origbs into newbs
echo "Executing command: dd if=/tmp/origbs of=/tmp/newbs skip=3 seek=3 bs=1 count=87 conv=notrunc"
dd if=/tmp/origbs of=/tmp/newbs skip=3 seek=3 bs=1 count=87 conv=notrunc
echo "Write Stage 1 loader"
# write newbs to the partition boot sector
echo "Executing command: dd if=/tmp/newbs of=${bootrdev}"
dd if=/tmp/newbs of=${bootrdev}
else
#Azipkg: this is was failing for me, hanged at boot0: done. Got fine when i removed "bs=512 count=1" ??
# makes no sense but... anyway, i'd remove this!.. no need to change EFI fs if boot1f32 works fine.
# In fact, i'm not a fan of EFI installs so, i'd remove it all!! :)
echo "Write Stage 1 loader"
# just write boot1h to the partition boot sector
echo "Executing command: dd if="${osxvolume}/usr/standalone/i386/${partitionloaderhfs}" of=${bootrdev}"
dd if="${osxvolume}/usr/standalone/i386/${partitionloaderhfs}" of=${bootrdev}
fi
echo "Executing command: dd if=/tmp/origbs of=/tmp/newbs skip=3 seek=3 bs=1 count=87 conv=notrunc"
dd if=/tmp/origbs of=/tmp/newbs skip=3 seek=3 bs=1 count=87 conv=notrunc
echo "Write Stage 1 loader"
echo "Executing command: dd of=${bootrdev} count=1 bs=512 if=/tmp/newbs"
dd if=/tmp/newbs of=${bootrdev} count=1 bs=512
echo "-----------------------------------------------"
echo ""
echo ""
#MAKEACTIVE
#fi
#Azipkg: works for EFI, but does it work for other GPT partitions?... check, was under the impression that NO??!
if [ ${disksignature} == "00000000" ]; then
# echo "Windows is not installed so let's change the active partition"
#checkpartitionbootcode check
#checkpartitionactive
#Azipkg: this forces the user to unmount the EFI part via terminal --> sudo umount /volumes/efi...?!
echo "==============================================="
echo "Mount EFI partition:"
echo "********************"
echo "Write Stage 2 loader"
echo "********************"
echo "Executing command: cp ${osxvolume}${filesystemloader} ${bootvolume}/boot"
cp "${osxvolume}${filesystemloader}" "${bootvolume}/boot"
echo "Executing command: cp "${osxvolume}/usr/standalone/i386/${filesystemloader}" ${bootvolume}/boot"
cp "${osxvolume}/usr/standalone/i386/${filesystemloader}" "${bootvolume}/boot"
echo "boot written"
#Azipkg: we're still missing copy Extra folder into EFI, else no themes & modules...???
echo "-----------------------------------------------"
echo ""

Archive Download the corresponding diff file

Revision: 1429