[ipxe-devel] Generating a BIOS/UEFI hybrid ISO image

Michael Brown mcb30 at ipxe.org
Tue Oct 5 11:58:53 UTC 2021


On 05/10/2021 09:38, Dean Westhead wrote:
> I may be missing something, but since the commit changed the file 
> src/util/geniso to src/util/genfsimg, I have not been able to generate 
> an ISO file that can be used to boot both BIOS and UEFI ... it always 
> only boots BIOS.
> 
> I admit that the changes that i was told to make to the geniso file, i 
> cant make to genfsimg becasue it is very different and i dont want to 
> break anything else in it !
> 
> Am I doing something wrong or is there a different set of instructions 
> to modify genfsimg to make it create this ISO correctly ?

You no longer need to make any modifications to genfsimg: it is already 
capable of building a combined BIOS and UEFI ISO (and can also handle 
multiple UEFI architectures, if you want e.g. a combined ISO that can 
handle BIOS, x86_64 UEFI, and AArch64 UEFI).

As per "./util/genfsimg -h":

usage: ./util/genfsimg [OPTIONS] foo.lkrn|foo.efi [bar.lkrn|bar.efi,...]

where OPTIONS are:
  -h         show this help
  -o FILE    save image to file
  -p PAD     pad filesystem (in kB)
  -s SCRIPT  use executable script

so you can build a combined image in two stages using e.g.

   make bin/ipxe.lkrn bin-x86_64-efi/ipxe.efi

   ./util/genfsimg -o combined.iso \
       bin/ipxe.lkrn bin-x86_64-efi/ipxe.efi

You can also use the "-s" option to specify a script that will be used 
by platforms (without needing to build using EMBED=...).  This is 
particularly useful if you build an editable FAT filesystem image 
instead of an ISO, using e.g.

   ./util/genfsimg -o combined.img -s myscript.ipxe \
       bin/ipxe.lkrn bin-x86_64-efi/ipxe.efi

since you can then mount the FAT filesystem image and edit the script 
(saved as "autoexec.ipxe") without needing to recompile.

Michael


More information about the ipxe-devel mailing list