User:Pjones/BootableCDsForBIOSAndUEFI

From FedoraProject

< User:Pjones
Revision as of 15:10, 15 October 2009 by Pjones (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Bootable CDs

In some cases, we want CDs to be bootable by both tradition BIOS and UEFI on the same systems. This means we need to do some special things to the disk.

The primary difference here is how the disc is created with mkisofs

  • Old BIOS way

With normal BIOS, the way to do this is something like:

mkisofs -U -A "RHEL_6.0 x86_64" -V "RHEL_6.0 x86_64 Disc 1" -volset "RHEL_6.0 x86_64" -J -joliet-long -r -v -T \
    -x ./lost+found -o /mnt/redhat/rel-eng/RHEL6.0-20091006.0/6/x86_64/iso/RHEL6.0-20091006.0-x86_64-disc1-dualboot.iso \
    -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table .

There are sections here, and to understand what changes are necessary for UEFI boot support, they must be identified. The first section is about the entire volume:

mkisofs -U -A "RHEL_6.0 x86_64" -V "RHEL_6.0 x86_64 Disc 1" -volset "RHEL_6.0 x86_64" -J -joliet-long -r -v -T \
    -x ./lost+found -o /mnt/redhat/rel-eng/RHEL6.0-20091006.0/6/x86_64/iso/RHEL6.0-20091006.0-x86_64-disc1.iso

This specifies global format options, such as the use of the joliet long filename format, and also the output image. The second section specifies information about how to create the El Torito boot image:

-b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table

The last section specifies the tree to find the files for the image:

.
  • New UEFI/BIOS hybrid method

To make a disk also EFI bootable, it needs an EFI bootable image, such as efiboot.img in our trees, and that needs to be inserted as a second El Torito boot image. To do this, we insert a 4th section between the El Torito section and the section about our tree, which looks like this:

-eltorito-alt-boot -e images/efiboot.img -no-emul-boot

Thus making the full command line look like:

mkisofs -U -A "RHEL_6.0 x86_64" -V "RHEL_6.0 x86_64 Disc 1" -volset "RHEL_6.0 x86_64" -J -joliet-long -r -v -T \
    -x ./lost+found -o /mnt/redhat/rel-eng/RHEL6.0-20091006.0/6/x86_64/iso/RHEL6.0-20091006.0-x86_64-disc1-dualboot.iso \
    -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table \
    -eltorito-alt-boot -e images/efiboot.img -no-emul-boot .
  • Testing the image

The first thing to do to test images is a simple smoke-test using the "dumpet" tool. Here's what it looks like with a traditional ISO image:

pjones4:/mnt/redhat/rel-eng/RHEL6.0-20091006.0/6/x86_64/iso$ dumpet -i RHEL6.0-20091006.0-x86_64-disc1-ftp.iso
Validation Entry:
	Header Indicator: 0x01 (Validation Entry)
	PlatformId: 0x00 (80x86)
	ID: ""
	Checksum: 0x55aa
	Key bytes: 0x55aa
Boot Catalog Default Entry:
	Entry is bootable
	Boot Media emulation type: no emulation
	Media load segment: 0x07c0
	System type: 0 (0x00)
	Load Sectors: 4 (0x0004)
	Load LBA: 154 (0x0000009a)