[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re : Making an ISO that boot in UEFI

From: Thomas Schmitt
Subject: Re: Re : Making an ISO that boot in UEFI
Date: Sun, 07 Feb 2021 09:31:31 +0100


Paul Dufresne wrote:
> It seems possible (to boot from a CDROM in UEFI) with SysLinux:
> https://wiki.syslinux.org/wiki/index.php?title=Isohybrid#UEFI

SYSLINUX is the bootloader which cannot boot via UEFI from optical media.
Its EFI code works from USB stick or hard disk, but not from DVD.

> unclear if it is with GRUB too...

About all GNU/Linux ISOs use GRUB for UEFI booting on x86. Only Knoppix
insists in SYSLINUX EFI from DVD ... and fails at least on real iron.

See for an example of x86 BIOS+EFI:

> ... and GNU Mach is not a Linux...

It seems that the Debian GNU/Hurd ISOs already use GRUB for booting via
legacy BIOS. So using GRUB for EFI would not be as inconvenient as for
Debian amd64, which needs configuration for both SYSLINUX and GRUB.

But afaik, it was not trivial to make the amd64 ISOs ready for EFI.
There was obviously more to do than just creating an EFI partition image
and putting it into the ISO. I guess that initrd and kernel needed
adaptions, too.

> according to man xorriso, that would looks like:
> -boot_image "grub" efi_path=bootefi.fat32 platform_id="0xef"

Each of the parameters gets submitted by its own -boot_image command.

The EFI boot equipment of an amd64 ISO in the native command language of

  $ xorriso -indev debian-10.6.0-amd64-netinst.iso -report_el_torito cmd
  -boot_image any efi_path='/boot/grub/efi.img'
  -boot_image any platform_id=0xef
  -boot_image any emul_type=no_emulation
  -boot_image any load_size=2899968
  -boot_image isolinux partition_entry=gpt_basdat
  -boot_image isolinux partition_entry=apm_hfsplus

Two of these commands are not really needed.
The size is assessed automatically if not given explicitely by:
  -boot_image any load_size=2899968
Having an Apple Partition Map makes only sense if the ISO has HFS or HFS+
as additional filesystem equipment:
  -boot_image isolinux partition_entry=apm_hfsplus

But i would expect that Hurd's ISO gets built by the mkisofs emulation

  $ xorriso -indev debian-10.6.0-amd64-netinst.iso -report_el_torito as_mkisofs
  -e '/boot/grub/efi.img'
  -boot-load-size 5664

Again, -boot-load-size is specific to the size of the EFI partition and can
be omitted, and -isohybrid-apm-hfsplus is useless.

> where bootefi.fat32 would be a file in FAT32 containing both:


If you want to tinker with GRUB and EFI, consider to build a minimal
grub-mkrescue ISO.
Install (maybe on a GNU/Linuux system) the Debian packages

  grub-common grub-pc-bin grub-efi-amd64-bin grub-efi-ia32-bin xorriso

and do

  mkdir minimal
  touch minimal/empty-file.txt
  grub-mkrescue -o output.iso minimal

The result output.iso will bear a partition table with a mountable FAT
partition. There you find GRUB's initial EFI boot stages.

There is a man-in-the-middle script in xorriso's source which can be used
to show and possibly alter the xorriso run of grub-mkrescue.
See the initial comments in the script, up to "Do the work".

To get shown the xorriso arguments, run:

  chmod u+x /...absolute.path.../grub-mkrescue-sed.sh

  export MKRESCUE_SED_MODE=original
  grub-mkrescue -o output.iso minimal \

My favorite is
Ubuntu recently switched to a layout that resembles much
because some Lenovo machines did not work with an appended MBR partition.

Have a nice day :)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]