[Buildroot] [PATCH v3 4/7] fs/iso9660: add support for hybrid image using Grub bootloader on BIOS and EFI

Köry Maincent kory.maincent at bootlin.com
Wed Sep 29 08:23:48 UTC 2021


Yann,

On Mon, 27 Sep 2021 23:05:14 +0200
"Yann E. MORIN" <yann.morin.1998 at free.fr> wrote:

> Köry, All,
> 
> On 2021-09-23 17:57 +0200, Kory Maincent spake thusly:
> > Add support for building an hybrid ISO9660 image compatible with legacy
> > and UEFI BIOS.
> > The option -eltorito-alt-boot need to be used in the xorriso command
> > to generate the hybrid image.  
> 
> So I was wondering why you had to rename the variables, and why you
> split the values with -eltorito-alt-boot right in between...
> 
> As I understand it from the xorriso command line, -eltorito-alt-boot
> basically means "OK, we're done with the previous boot parameters, now
> we start a new set of boot parameters", so the order of options *is*
> important.
> 
> Right?

Right

> 
> Furthermore, -eltorito-alt-boot and -no-emul-boot are not conflicting,
> because the former is really this separator as discussed above, while
> the latter specifies the type of the current boot image.
> 
> Right?

Right

> 
> (For my information: how many such alternate boot parameters can we
> define: is it limited to just two, or can we add more?)

According to xorriso manual we can add up to 32 boot catalog entries.

> 
> > Signed-off-by: Kory Maincent <kory.maincent at bootlin.com>
> > ---  
> [--SNIP--]
> > diff --git a/fs/iso9660/iso9660.mk b/fs/iso9660/iso9660.mk
> > index 921efa1b02..9c2535d102 100644
> > --- a/fs/iso9660/iso9660.mk
> > +++ b/fs/iso9660/iso9660.mk  
> [--SNIP--]
> > @@ -151,24 +156,32 @@ endif # ROOTFS_ISO9660_USE_INITRD
> >  
> >  ROOTFS_ISO9660_OPTS += \
> >  	-J \
> > -	-R \
> > -	-no-emul-boot
> > +	-R
> >  
> > -ifeq ($(BR2_TARGET_ROOTFS_ISO9660_BIOS_BOOTLOADER),y)
> > -ROOTFS_ISO9660_OPTS += \
> > +ROOTFS_ISO9660_BOOTLOADER_OPTS_BIOS = \  
> 
>     ROOTFS_ISO9660_OPTS_BIOS
> 
> > +	-b $(ROOTFS_ISO9660_BOOT_IMAGE) \
> > +	-no-emul-boot \
> >  	-boot-load-size 4 \
> > -	-boot-info-table \
> > -	-b $(ROOTFS_ISO9660_BOOT_IMAGE)
> > -endif
> > +	-boot-info-table  
> 
> You are also reordering the remaining options. Is that really necessary?
> Or is it for symmetry with the EFI case where the "image" option comes
> first?

It was for symmetry.

> 
> > -ifeq ($(BR2_TARGET_ROOTFS_ISO9660_EFI_BOOTLOADER),y)
> > -ROOTFS_ISO9660_OPTS += \
> > -	--efi-boot $(ROOTFS_ISO9660_EFI_PARTITION)
> > +ROOTFS_ISO9660_BOOTLOADER_OPTS_EFI = \  
> 
>     ROOTFS_ISO9660_OPTS_EFI
> 
> > +	--efi-boot $(ROOTFS_ISO9660_EFI_PARTITION) \
> > +	-no-emul-boot
> > +
> > +ifeq
> > ($(BR2_TARGET_ROOTFS_ISO9660_BIOS_BOOTLOADER)$(BR2_TARGET_ROOTFS_ISO9660_EFI_BOOTLOADER),yy)
> > +ROOTFS_ISO9660_BOOTLOADER_OPTS = $(ROOTFS_ISO9660_BOOTLOADER_OPTS_BIOS)
> > +ROOTFS_ISO9660_BOOTLOADER_OPTS += -eltorito-alt-boot
> > +ROOTFS_ISO9660_BOOTLOADER_OPTS += $(ROOTFS_ISO9660_BOOTLOADER_OPTS_EFI)  
> 
> Hmmm This is pretty ugly... What about:
> 
>     ROOTFS_ISO9660_OPTS += \
>         $(ROOTFS_ISO9660_OPTS_BIOS) \
>         -eltorito-alt-boot \
>         $(ROOTFS_ISO9660_OPTS_EFI)
> 
> Also, does BIOS really has to come before EFI? If so, why?

It seems BIOS need to be the first boot option. I have not found any
information about it but if I invert BIOS and EFI options it doesn't boot. 

Regards,
Köry



More information about the buildroot mailing list