User:Pjones/BootableCDsForBIOSAndUEFI

From FedoraProject

< User:Pjones(Difference between revisions)
Jump to: navigation, search
m (Minor wiki changes)
Line 1: Line 1:
== Bootable CDs ==
+
= 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.
 
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.
Line 5: Line 5:
 
The primary difference here is how the disc is created with mkisofs
 
The primary difference here is how the disc is created with mkisofs
  
*Old BIOS way
+
== Old BIOS way ==
 +
 
 
With normal BIOS, the way to do this is something like:
 
With normal BIOS, the way to do this is something like:
 
<pre>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 \
 
<pre>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 \
Line 19: Line 20:
 
<pre>.</pre>
 
<pre>.</pre>
  
*New UEFI/BIOS hybrid method
+
== 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:
 
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:
 
<pre>-eltorito-alt-boot -e images/efiboot.img -no-emul-boot</pre>
 
<pre>-eltorito-alt-boot -e images/efiboot.img -no-emul-boot</pre>
Line 28: Line 30:
 
     -eltorito-alt-boot -e images/efiboot.img -no-emul-boot .</pre>
 
     -eltorito-alt-boot -e images/efiboot.img -no-emul-boot .</pre>
  
* Testing the image
+
== 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:
 
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:
 
<pre>pjones4:/mnt/redhat/rel-eng/RHEL6.0-20091006.0/6/x86_64/iso$ dumpet -i RHEL6.0-20091006.0-x86_64-disc1-ftp.iso
 
<pre>pjones4:/mnt/redhat/rel-eng/RHEL6.0-20091006.0/6/x86_64/iso$ dumpet -i RHEL6.0-20091006.0-x86_64-disc1-ftp.iso
Line 44: Line 47:
 
Load Sectors: 4 (0x0004)
 
Load Sectors: 4 (0x0004)
 
Load LBA: 154 (0x0000009a)</pre>
 
Load LBA: 154 (0x0000009a)</pre>
There are some important aspects here:
+
 
 +
There are some important considerations, including:
 
* The PlatformId is 0x0 (which means "PC")
 
* The PlatformId is 0x0 (which means "PC")
 
* The Boot Catalog Default Entry is bootable, with no emulation
 
* The Boot Catalog Default Entry is bootable, with no emulation
Line 77: Line 81:
 
Load Sectors: 776 (0x0308)
 
Load Sectors: 776 (0x0308)
 
Load LBA: 154 (0x0000009a)</pre>
 
Load LBA: 154 (0x0000009a)</pre>
 +
 
The BIOS entry looks the same, except for the Load LBA (the address of the image on the disc), but there's also another Section Header Entry and Boot Catalog Section Entry, which specify the UEFI boot image.  The important aspects of this are:
 
The BIOS entry looks the same, except for the Load LBA (the address of the image on the disc), but there's also another Section Header Entry and Boot Catalog Section Entry, which specify the UEFI boot image.  The important aspects of this are:
 
* PlatformId is 0xef (EFI)
 
* PlatformId is 0xef (EFI)
Line 84: Line 89:
  
 
If all these things are correct, and EFI system should see the efiboot.img, and if it is formed correctly, then you've got bootable media on a UEFI machine and BIOS machines.
 
If all these things are correct, and EFI system should see the efiboot.img, and if it is formed correctly, then you've got bootable media on a UEFI machine and BIOS machines.
 +
 +
= Bootable USB =
 +
 +
<<FIXME>>

Revision as of 15:27, 15 October 2009

Contents

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)

There are some important considerations, including:

  • The PlatformId is 0x0 (which means "PC")
  • The Boot Catalog Default Entry is bootable, with no emulation
  • Media load segment is 0x7c0 - this will always be true for a BIOS image
  • Load sectors is "4" - this will always be true for a BIOS image

On a UEFI/BIOS hybrid image, the output will look like this:

pjones4:/mnt/redhat/rel-eng/RHEL6.0-20091006.0/6/x86_64/iso$ dumpet -i RHEL6.0-20091006.0-x86_64-disc1-dualboot.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: 348 (0x0000015c)
Section Header Entry:
	Header Indicator: 0x91 (Final Section Header Entry)
	PlatformId: 0xef (EFI)
	Section Entries: 1
	ID: ""
Boot Catalog Section Entry:
	Entry is bootable
	Boot Media emulation type: no emulation
	Media load address: 0 (0x0000)
	System type: 0 (0x00)
	Load Sectors: 776 (0x0308)
	Load LBA: 154 (0x0000009a)

The BIOS entry looks the same, except for the Load LBA (the address of the image on the disc), but there's also another Section Header Entry and Boot Catalog Section Entry, which specify the UEFI boot image. The important aspects of this are:

  • PlatformId is 0xef (EFI)
  • The Boot Catalog Section Entry is bootable, with no emulation
  • Media load address is 0
  • "Load Sectors" is NOT 4. Load Sectors * 2048 should be the size of efiboot.img rounded up to a multiple of 2048

If all these things are correct, and EFI system should see the efiboot.img, and if it is formed correctly, then you've got bootable media on a UEFI machine and BIOS machines.

Bootable USB

<<FIXME>>