bug-xorriso
[Top][All Lists]
Advanced

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

Re: [Buildroot] Hybrid UEFI-Only CD-ROM image with systemd-boot


From: Thomas Schmitt
Subject: Re: [Buildroot] Hybrid UEFI-Only CD-ROM image with systemd-boot
Date: Fri, 08 Nov 2024 10:28:39 +0100

Hi,

Thomas Kindler wrote:
> Is there a way to generate only one partition?

Not with GPT.
The man page promises this to happen with -append_partition 1 for MBR
partitions. But this does not work with GPT partitions.
man 1 xorriso:

  -append_partition partition_number type_code disk_path
      ...
      With MBR:
      partition_number may be 1 to 4. Number 1 will put the whole  ISO
      image  into  the unclaimed space before partition 1.
      ...
      GPT can be forced by
        -boot_image "any" "appended_part_as=gpt"
      partition_number may  be  1  to  8.  But  other  than  with  MBR
      partitions it is not guaranteed that the resulting GPT partition
      will have this number.
      More important than the desired partition number  will  be  that
      the resulting ISO filesystem is covered gaplessly with GPT table
      and its partitions and that the  partitions  in  the  table  are
      sorted  by block address.

(-boot_image "any" "appended_part_as=gpt" is in the native command set of
 xorriso the equivalent of -as "mkisofs" option -appended_part_as_gpt.)

Experiments:

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

still yields with fdisk:

  Disklabel type: gpt
  Disk identifier: 02ACD30B-A5C2-47E6-8273-DA83B6BF77AA

  Device     Start   End Sectors Size Type
  cdrom.iso1    64   139      76  38K Microsoft basic data
  cdrom.iso2   140 20491   20352  10M EFI System

If i omit option -appended_part_as_gpt i get:

  Disklabel type: dos
  Disk identifier: 0x00000000

  Device     Boot Start   End Sectors Size Id Type
  cdrom.iso1        140 20491   20352  10M ef EFI (FAT-12/16/32)


I will investigate whether the GPT partition number can be forced to
the number given by the user. But i am not optimistic about this.
The rule of having gapless GPT stems from work done for grub-mkrescue
over a decade ago. I would have to find out whether this demand of
Vladimir Serbinko is purely esthetic or has a hard reason.


Have a nice day :)

Thomas




reply via email to

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