4

I am trying to create a custom ISO from a rhel-8 installation disk that can boot on either a BIOS or an EFI server. Everything goes fine until I try to create the iso. If I run the following command:

mkisofs -J -R -T -V "NGS-8.4-0 Server" \
    -o ngs-8.4-0.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 \
    -m TRANS.TBL \
    ngs-dvd

I get the following output:

Creating NGS iso...I: -input-charset not specified, using iso-8859-1 (detected in locale settings)

(bunch of TRANS.TBL output deleted)

Size of boot image is 4 sectors -> No emulation
Size of boot image is 19612 sectors -> genisoimage: Error - boot image '/NGS/ngs-dvd/images/efiboot.img' has not an allowable size.

However, if I delete two options (--eltorito-alt-boot & -e images/efiboot.img), it creates a bootable iso. What am I doing wrong?

Garnet
  • 366
  • 2
  • 13
  • https://superuser.com/questions/357512/why-is-my-linux-reporting-an-allowable-size-error-when-building-an-iso/359247 – pbies Oct 28 '21 at 20:00
  • @pbies I l already read that. It didn't help since I already had the 3 options that answer said should be added `no-emul-boot`, `boot-load-size`, and `boot-into-table`. And, the command works if I only try to make a BIOS only bootable iso. – Garnet Oct 28 '21 at 20:08
  • Then: https://askubuntu.com/questions/625286/how-to-create-uefi-bootable-iso – pbies Oct 28 '21 at 22:56

2 Answers2

4

It appears that I needed the -no-emul-boot option twice. One for each boot image (BIOS & EFI). The final working configuration was:

/usr/bin/mkisofs -J -R -T -V "NGS-8.4-0 Server" \
    -o ngs-8.4-0.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 \
    -m TRANS.TBL \
    ngs-dvd
Garnet
  • 366
  • 2
  • 13
  • you made my day. with this I was finally able to make an iso file almost as original. Start is `33 ed 90` instead of `45 52 08` and https://mjg59.dreamwidth.org/11285.html hints me Apple support is missing. When have you got `-e` option from? It is not in man page (at least on my system). Also have not found it on https://linux.die.net/man/8/mkisofs. – Martian2020 Nov 28 '21 at 13:00
  • 1
    @Martian2020 I don't remember exactly where I got it. I looked at so many web pages describing how to make a bootable iso that they are all a blur. However, it is in my man page for mkisofs(1): `-e efi_boot_file Set EFI boot image name.` ` – Garnet Nov 28 '21 at 16:44
3

From man page:

-eltorito-alt-boot Start with a new set of El Torito boot parameters. Up to 63 El Torito boot entries may be stored on a single CD.

So the finding in your answer that you need to add -no-emul-boot again after -eltorito-alt-boot means EFI image added by -e also need -no-emul-boot to work properly and as it is next El Torito entry and starts with new set of parameters, needed parameters need to be explicitly listed again.

From the question:

However, if I delete two options (--eltorito-alt-boot & -e images/efiboot.img), it creates a bootable iso.

I've done that way initially too, it created iso that resulted in legacy boot only (no EFI, -e adds part that becomes EFI partition on USB later).

BTW, before writing to USB isohybrid --uefi new.iso command is needed.

There appears to be good related post+discussion Anatomy of a Fedora 17 ISO image, I have not read it all yet.

P.S. why many other options are critical (e.g. no size except 4 seems to work out) I have not been able to find out (as of now). -e option appears to be absent in man pages on my system, but works. https://wiki.osdev.org/Mkisofs:

-e ISOPATH announces a data file as El Torito boot image for EFI. This is not an option of original mkisofs, but is understood by some variants of genisoimage and by xorriso -as mkisofs.

Martian2020
  • 1,039
  • 7
  • 20