[syslinux] isohybrid --uefi - resulting EF00 partition too small

Thomas Schmitt scdbackup at gmx.net
Tue Mar 12 09:31:47 PDT 2013


Hi,

> isohybrid --uefi name-of.iso
> the resulting GPT entry for the EF00 partition is just 19MB. It should 
> be around 53MB:

I reported some potential problems with isohybrid.c in may 2012:
  http://www.syslinux.org/archives/2012-May/017843.html
But this one is not among them.

After looking into
  http://git.kernel.org/cgit/boot/syslinux/syslinux.git/tree/utils/isohybrid.c
i got a suspicion. Function read_efi_catalogue() does this

  memcpy(count, buf, 2);
  *count = lendian_short(*count);

Two bytes of block count would rollover 104448 to 38912 = 19 MiB.

This is not a bug of the implementation but of the concept of
isohybrid option --uefi. It tries to take start address and size
from the El Torito catalog, rather than inspecting the ISO 9660
directories.


> Did just my large FAT image make me run into some side effects?

It seems so. El Torito cannot record image sizes above 32 MiB.

Obviously hardly anybody cared up to now.
I will have to change this rolling over in libisofs before some
mishap produces -boot-load-size 0 that way.

But a true size of your EFI boot image cannot be stored.
I can only store 65535 rather than 38912.


> The ISO image was built using xorriso 1.1.8

With a younger xorriso you could try to let it generate the GPT
together with the isohybrid MBR:

  mbr_file=/usr/lib/syslinux/isohdpfx.bin

  xorriso -as mkisofs \
     -graft-points \
     -c boot/isolinux/boot.cat \
     -b boot/isolinux/isolinux.bin \
       -no-emul-boot -boot-info-table -boot-load-size 4 \
       -isohybrid-mbr $mbr_file \
     -eltorito-alt-boot \
     -e boot/efi.img \
       -no-emul-boot \
       -isohybrid-gpt-basdat \
     -V LESSLINUX-SEARCH-AND-RESCUE \
     -o lesslinux-search-and-rescue-uluru-20130312-110347.iso \
     -r \
     cdmaster \
     --sort-weight 0 / --sort-weight 1 /boot

Suitable would be the current release
  http://www.gnu.org/software/xorriso/xorriso-1.2.6.tar.gz
For compilation instructions see
  http://www.gnu.org/software/xorriso/README_xorriso


> Of course in this case I would neither blame Thomas Schmitt nor Matthew 
> Garrett nor anyone else who did a great job on making isohybrid work

I'm just trying to implement what i learned from Peter, Matthew,
Vladimir Serbinenko, and Wikipedia. Don't blame success on me.
I can only add more points of failure. :))

In principle it should be possible to present all your four intended
boot starting points in one ISO image. Especially the correct size
for the EFI FAT GPT partition should be achievable.
It might be, of course, that some boot facility reacts allergic
on the parallel existence of these starting points.


> If you want to examine the resulting ISO image

I repacked your ISO by essentially above command proposal:

  mv lesslinux-search-and-rescue-uluru-20130312-110347.iso \
     lesslinux-search-and-rescue-uluru-20130312-110347_orig.iso
  dd if=lesslinux-search-and-rescue-uluru-20130312-110347_orig.iso \
     bs=512 count=1 \
     of=lesslinux-search-and-rescue-uluru-20130312-110347.sysarea
  mount -o loop \
        lesslinux-search-and-rescue-uluru-20130312-110347_orig.iso /mnt

  mbr_file=lesslinux-search-and-rescue-uluru-20130312-110347.sysarea

  xorriso -as mkisofs \
     ...like above ...
     /mnt \
     --sort-weight 0 / --sort-weight 1 /boot

fdisk reports:
  Device       Boot      Start         End      Blocks   Id  System
  less*47.iso2             228      104675       52224   ef  EFI (FAT-12/16/32)

There are two GPT partitions.
The first one begins at block 0 and ends after block 1413055.
The second one starts at block 228 and ends after 104675.

xorriso reports
  Report layout: xt , Startlba ,   Blocks , Filesize , ISO image path
  File data lba:  0 ,       57 ,    26112 , 53477376 , '/boot/efi.img'

Given the block size factors between xorriso, fdisk, and GPT, this
all seems to match.


Have a nice day :)

Thomas



More information about the Syslinux mailing list