[Buildroot] [PATCH v3 4/7] fs/iso9660: add support for hybrid image using Grub bootloader on BIOS and EFI
Yann E. MORIN
yann.morin.1998 at free.fr
Mon Sep 27 21:05:14 UTC 2021
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?
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?
(For my information: how many such alternate boot parameters can we
define: is it limited to just two, or can we add more?)
> 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?
> -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?
> +else ifeq ($(BR2_TARGET_ROOTFS_ISO9660_BIOS_BOOTLOADER),y)
> +ROOTFS_ISO9660_BOOTLOADER_OPTS = $(ROOTFS_ISO9660_BOOTLOADER_OPTS_BIOS)
ROOTFS_ISO9660_OPTS += $(ROOTFS_ISO9660_OPTS_BIOS)
> +else ifeq ($(BR2_TARGET_ROOTFS_ISO9660_EFI_BOOTLOADER),y)
> +ROOTFS_ISO9660_BOOTLOADER_OPTS = $(ROOTFS_ISO9660_BOOTLOADER_OPTS_EFI)
ROOTFS_ISO9660_OPTS += $(ROOTFS_ISO9660_OPTS_EFI)
> endif
>
> define ROOTFS_ISO9660_CMD
> $(HOST_DIR)/bin/xorriso -as mkisofs \
> $(ROOTFS_ISO9660_OPTS) \
> + $(ROOTFS_ISO9660_BOOTLOADER_OPTS) \
And thus you don't need the new variable here.
Regards,
Yann E. MORIN.
> -o $@ $(ROOTFS_ISO9660_TMP_TARGET_DIR)
> endef
>
> --
> 2.25.1
>
> _______________________________________________
> buildroot mailing list
> buildroot at lists.buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
More information about the buildroot
mailing list