Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Schmitt via buildroot <buildroot@buildroot.org>
To: buildroot@buildroot.org
Subject: Re: [Buildroot] Hybrid UEFI-Only CD-ROM image with systemd-boot
Date: Thu, 07 Nov 2024 08:09:19 +0100	[thread overview]
Message-ID: <17085327765155587732@scdbackup.webframe.org> (raw)
In-Reply-To: <cb32292a0142d6f4e097385272e6fb83.squirrel@t-kindler.de>

Hi,

consider to Cc: bug-xorriso@gnu.org when asking xorriso questions.


> 1) How can I get xorriso to generate an image with only the EFI partition?

If all is in the EFI partition, you want GPT, and want to avoid nested
partitions, try with an appended partition attached to a minimal ISO with
a dummy file (here: README).

  # There is no need to have $BINARIES_DIR/cdrom

  echo "No payload data in this ISO 9660 filesystem" >README

  xorriso -as mkisofs \
      -o "$BINARIES_DIR"/cdrom.iso \
      -eltorito-catalog boot.cat \
      -appended_part_as_gpt \
      -partition_offset 16 \
      -append_partition 2 0xef "$BINARIES_DIR"/efi-part.vfat \
      -e --interval:appended_partition_2:all:: \
        -no-emul-boot \
      -no-pad \
      README

The resulting .iso then yields with fdisk -l something like:

  Disklabel type: gpt
  Disk identifier: 402F6C62-D96C-4257-B9A8-A4E20CD84888

  Device     Start   End Sectors Size Type
  cdrom.iso1    64   203     140  70K Microsoft basic data
  cdrom.iso2   204 20555   20352  10M EFI System

Partition 1 is mountable and represents the same ISO 9660 file tree
as the base device. (This comes at the expense of two superblocks
and two trees of directory records in the ISO.)

The EFI partition is outside of the ISO 9660 filesystem of partition 1.
Nevertheless the ISO 9660 filesystem of the base device claims the size
up to the end of partition 2.
So in the case of virtual CDROM, the EFI partition in its role as
El Torito boot image appears as hidden file of the CDROM's ISO 9660
filesystem.

  $ xorriso -indev cdrom.iso -report_el_torito plain
  ...
  El Torito catalog  : 49  1
  El Torito cat path : /boot.catalog
  El Torito images   :   N  Pltf  B   Emul  Ld_seg  Hdpt  Ldsiz         LBA
  El Torito boot img :   1  UEFI  y   none  0x0000  0x00  20352          51
  El Torito img blks :   1  5088


> 2) Shouldn't xorriso generate a GPT table? fdisk says "Disklabel type: dos"
>
> 3) Why do I need isohdpfx.bin and isolinux.bin at all?!
> I only want to support UEFI systems, and this seems to be legacy BIOS
> related?

You probably follow the Mac-less renarration of xorriso's implementation
of a Fedora isohybrid layout originally created by the ISOLINUX program
named "isohybrid":
  http://mjg59.dreamwidth.org/11285.html
  "Anatomy of a Fedora 17 ISO image"
  by Matthew Garret, May 2012

It works by an MBR partition table ("dos"), but also contains a GPT header
block (not announced by the MBR partition table). The GPT header has the
purpose to lure EFI firmwares which do not consider drives whithout GPT.
For some pre-EFI-but-already-x86 Macs there is an Apple Partition Map
with partitions pointing to the EFI image and a small HFS+ image.

Your xorriso run omits the production of the Apple partition map.
Debian uses a similar layout for its installation ISOs.
It yields good boot success but is hard to digest for partition editors.


Have a nice day :)

Thomas

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2024-11-07  7:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-06 11:26 [Buildroot] Hybrid UEFI-Only CD-ROM image with systemd-boot Thomas Kindler
2024-11-07  7:09 ` Thomas Schmitt via buildroot [this message]
2024-11-08  7:53   ` Thomas Kindler
2024-11-08  9:28     ` Thomas Schmitt via buildroot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=17085327765155587732@scdbackup.webframe.org \
    --to=buildroot@buildroot.org \
    --cc=scdbackup@gmx.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox