From Fedora Project Wiki
m (Minor wiki changes)
m (Fix typo.)
 
(6 intermediate revisions by the same user not shown)
Line 8: Line 8:


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 "MyLinux_1 x86_64" -V "MyLinux_1 x86_64 Disc 1" \
    -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 \
    -volset "MyLinux_1 x86_64" -J -joliet-long -r -v -T -x ./lost+found \
     -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table .</pre>
    -o /home/pjones/MyLinux/1/x86_64/iso/MyLinux-1-x86_64-disc1-dualboot.iso \
     -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 \
    -boot-info-table .</pre>
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:
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:
<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 "MyLinux_1 x86_64" -V "MyLinux_1 x86_64 Disc 1" \
    -x ./lost+found -o /mnt/redhat/rel-eng/RHEL6.0-20091006.0/6/x86_64/iso/RHEL6.0-20091006.0-x86_64-disc1.iso</pre>
    -volset "MyLinux_1 x86_64" -J -joliet-long -r -v -T -x ./lost+found \
    -o /home/pjones/MyLinux/1/x86_64/iso/MyLinux-1-x86_64-disc1.iso</pre>
This specifies global format options, such as the use of the joliet long filename format, and also the output image.
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:
The second section specifies information about how to create the El Torito boot image:
<pre>-b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table</pre>
<pre>-b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot \
    -boot-load-size 4 -boot-info-table</pre>
The last section specifies the tree to find the files for the image:
The last section specifies the tree to find the files for the image:
<pre>.</pre>
<pre>.</pre>
Line 25: Line 29:
<pre>-eltorito-alt-boot -e images/efiboot.img -no-emul-boot</pre>
<pre>-eltorito-alt-boot -e images/efiboot.img -no-emul-boot</pre>
Thus making the full command line look like:
Thus making the full command line look 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 "MyLinux_1 x86_64" -V "MyLinux_1 x86_64 Disc 1" \
    -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 \
    -volset "MyLinux_1 x86_64" -J -joliet-long -r -v -T -x ./lost+found \
     -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table \
    -o /home/pjones/MyLinux/1/x86_64/iso/MyLinux_1-x86_64-disc1-dualboot.iso \
    -eltorito-alt-boot -e images/efiboot.img -no-emul-boot .</pre>
     -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 .</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:/home/pjones/MyLinux/1/x86_64/iso$ dumpet -i MyLinux_1-x86_64-disc1-ftp.iso
Validation Entry:
Validation Entry:
Header Indicator: 0x01 (Validation Entry)
Header Indicator: 0x01 (Validation Entry)
Line 43: Line 48:
Entry is bootable
Entry is bootable
Boot Media emulation type: no emulation
Boot Media emulation type: no emulation
Media load segment: 0x07c0
Media load segment: 0x0 (0000:7c00)
System type: 0 (0x00)
System type: 0 (0x00)
Load Sectors: 4 (0x0004)
Load Sectors: 4 (0x0004)
Line 51: Line 56:
* 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
* Media load segment is 0x7c0 - this will always be true for a BIOS image
* Media load segment is 0000:7c00 - this will always be true for a BIOS image in Fedora
** dumpet 1.1 incorrectly said 0x7c0 here.
* Load sectors is "4" - 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:
On a UEFI/BIOS hybrid image, the output will look like this:
<pre>pjones4:/mnt/redhat/rel-eng/RHEL6.0-20091006.0/6/x86_64/iso$ dumpet -i RHEL6.0-20091006.0-x86_64-disc1-dualboot.iso  
<pre>pjones4:/home/pjones/MyLinux/1/x86_64/iso$ dumpet -i MyLinux_1-x86_64-disc1-dualboot.iso  
Validation Entry:
Validation Entry:
Header Indicator: 0x01 (Validation Entry)
Header Indicator: 0x01 (Validation Entry)
Line 65: Line 71:
Entry is bootable
Entry is bootable
Boot Media emulation type: no emulation
Boot Media emulation type: no emulation
Media load segment: 0x07c0
Media load segment: 0x0 (0000:7c00)
System type: 0 (0x00)
System type: 0 (0x00)
Load Sectors: 4 (0x0004)
Load Sectors: 4 (0x0004)
Line 88: Line 94:
* "Load Sectors" is <strong>NOT</strong> 4.  Load Sectors * 2048 should be the size of efiboot.img rounded up to a multiple of 2048
* "Load Sectors" is <strong>NOT</strong> 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.
If all these things are correct, an 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>>

Latest revision as of 20:10, 20 August 2010

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 "MyLinux_1 x86_64" -V "MyLinux_1 x86_64 Disc 1" \
    -volset "MyLinux_1 x86_64" -J -joliet-long -r -v -T -x ./lost+found \
    -o /home/pjones/MyLinux/1/x86_64/iso/MyLinux-1-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 "MyLinux_1 x86_64" -V "MyLinux_1 x86_64 Disc 1" \
    -volset "MyLinux_1 x86_64" -J -joliet-long -r -v -T -x ./lost+found \
    -o /home/pjones/MyLinux/1/x86_64/iso/MyLinux-1-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 "MyLinux_1 x86_64" -V "MyLinux_1 x86_64 Disc 1" \
    -volset "MyLinux_1 x86_64" -J -joliet-long -r -v -T -x ./lost+found \
    -o /home/pjones/MyLinux/1/x86_64/iso/MyLinux_1-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:/home/pjones/MyLinux/1/x86_64/iso$ dumpet -i MyLinux_1-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: 0x0 (0000:7c00)
	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 0000:7c00 - this will always be true for a BIOS image in Fedora
    • dumpet 1.1 incorrectly said 0x7c0 here.
  • 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:/home/pjones/MyLinux/1/x86_64/iso$ dumpet -i MyLinux_1-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: 0x0 (0000:7c00)
	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, an 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.