diff --git a/fs/iso9660/Config.in b/fs/iso9660/Config.in index f8f577506d..8c4e7badf8 100644 --- a/fs/iso9660/Config.in +++ b/fs/iso9660/Config.in @@ -27,6 +27,10 @@ choice config BR2_TARGET_ROOTFS_ISO9660_GRUB2 bool "grub2" depends on BR2_TARGET_GRUB2 + select BR2_TARGET_ROOTFS_ISO9660_BIOS_BOOTLOADER \ + if BR2_TARGET_GRUB2_I386_PC + select BR2_TARGET_ROOTFS_ISO9660_EFI_BOOTLOADER \ + if (BR2_TARGET_GRUB2_I386_EFI || BR2_TARGET_GRUB2_X86_64_EFI) help Use Grub 2 as the bootloader for the ISO9660 image. Make sure to enable the 'iso9660' module in @@ -39,21 +43,15 @@ config BR2_TARGET_ROOTFS_ISO9660_GRUB2 config BR2_TARGET_ROOTFS_ISO9660_ISOLINUX bool "isolinux" depends on BR2_TARGET_SYSLINUX_ISOLINUX + select BR2_TARGET_ROOTFS_ISO9660_BIOS_BOOTLOADER endchoice -choice - prompt "Boot payload" - config BR2_TARGET_ROOTFS_ISO9660_BIOS_BOOTLOADER - bool "legacy bios" - depends on BR2_TARGET_GRUB2_I386_PC || BR2_TARGET_ROOTFS_ISO9660_ISOLINUX + bool config BR2_TARGET_ROOTFS_ISO9660_EFI_BOOTLOADER - bool "UEFI" - depends on BR2_TARGET_GRUB2_I386_EFI || BR2_TARGET_GRUB2_X86_64_EFI - -endchoice + bool config BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU string "Boot menu config file" diff --git a/fs/iso9660/iso9660.mk b/fs/iso9660/iso9660.mk index faa15833c2..0524f94c35 100644 --- a/fs/iso9660/iso9660.mk +++ b/fs/iso9660/iso9660.mk @@ -69,18 +69,20 @@ ROOTFS_ISO9660_DEPENDENCIES += grub2 ROOTFS_ISO9660_BOOTLOADER_CONFIG_PATH = \ $(ROOTFS_ISO9660_TMP_TARGET_DIR)/boot/grub/grub.cfg ROOTFS_ISO9660_BOOT_IMAGE = boot/grub/grub-eltorito.img -define ROOTFS_ISO9660_INSTALL_BOOTLOADER +define ROOTFS_ISO9660_INSTALL_BOOTLOADER_BIOS $(INSTALL) -D -m 0644 $(BINARIES_DIR)/grub-eltorito.img \ $(ROOTFS_ISO9660_TMP_TARGET_DIR)/boot/grub/grub-eltorito.img endef -else ifeq ($(BR2_TARGET_ROOTFS_ISO9660_GRUB2)$(BR2_TARGET_ROOTFS_ISO9660_EFI_BOOTLOADER),yy) +endif + +ifeq ($(BR2_TARGET_ROOTFS_ISO9660_GRUB2)$(BR2_TARGET_ROOTFS_ISO9660_EFI_BOOTLOADER),yy) ROOTFS_ISO9660_DEPENDENCIES += grub2 host-dosfstools host-mtools ROOTFS_ISO9660_EFI_PARTITION = boot/fat.efi ROOTFS_ISO9660_EFI_PARTITION_PATH = $(ROOTFS_ISO9660_TMP_TARGET_DIR)/$(ROOTFS_ISO9660_EFI_PARTITION) ROOTFS_ISO9660_EFI_PARTITION_CONTENT = $(BINARIES_DIR)/efi-part ROOTFS_ISO9660_BOOTLOADER_CONFIG_PATH = \ $(ROOTFS_ISO9660_TMP_TARGET_DIR)/boot/grub/grub.cfg -define ROOTFS_ISO9660_INSTALL_BOOTLOADER +define ROOTFS_ISO9660_INSTALL_BOOTLOADER_EFI rm -rf $(ROOTFS_ISO9660_EFI_PARTITION_PATH) mkdir -p $(dir $(ROOTFS_ISO9660_EFI_PARTITION_PATH)) dd if=/dev/zero of=$(ROOTFS_ISO9660_EFI_PARTITION_PATH) bs=1M count=1 @@ -90,12 +92,14 @@ define ROOTFS_ISO9660_INSTALL_BOOTLOADER $(ROOTFS_ISO9660_EFI_PARTITION_CONTENT)/* ::/ $(ROOTFS_ISO9660_FIX_TIME) $(ROOTFS_ISO9660_EFI_PARTITION_PATH) endef -else ifeq ($(BR2_TARGET_ROOTFS_ISO9660_ISOLINUX),y) +endif + +ifeq ($(BR2_TARGET_ROOTFS_ISO9660_ISOLINUX),y) ROOTFS_ISO9660_DEPENDENCIES += syslinux ROOTFS_ISO9660_BOOTLOADER_CONFIG_PATH = \ $(ROOTFS_ISO9660_TMP_TARGET_DIR)/isolinux/isolinux.cfg ROOTFS_ISO9660_BOOT_IMAGE = isolinux/isolinux.bin -define ROOTFS_ISO9660_INSTALL_BOOTLOADER +define ROOTFS_ISO9660_INSTALL_BOOTLOADER_BIOS $(INSTALL) -D -m 0644 $(BINARIES_DIR)/syslinux/* \ $(ROOTFS_ISO9660_TMP_TARGET_DIR)/isolinux/ $(INSTALL) -D -m 0644 $(HOST_DIR)/share/syslinux/ldlinux.c32 \ @@ -108,7 +112,8 @@ define ROOTFS_ISO9660_PREPARATION $(ROOTFS_ISO9660_BOOTLOADER_CONFIG_PATH) $(SED) "s%__KERNEL_PATH__%/boot/$(LINUX_IMAGE_NAME)%" \ $(ROOTFS_ISO9660_BOOTLOADER_CONFIG_PATH) - $(ROOTFS_ISO9660_INSTALL_BOOTLOADER) + $(ROOTFS_ISO9660_INSTALL_BOOTLOADER_BIOS) + $(ROOTFS_ISO9660_INSTALL_BOOTLOADER_EFI) endef ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_PREPARATION @@ -152,21 +157,27 @@ ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_DISABLE_EXTERNAL_INITRD endif # ROOTFS_ISO9660_USE_INITRD -ROOTFS_ISO9660_OPTS += \ - -J \ - -R \ +ROOTFS_ISO9660_OPTS += -J -R + +ROOTFS_ISO9660_OPTS_BIOS = \ + -b $(ROOTFS_ISO9660_BOOT_IMAGE) \ + -no-emul-boot \ + -boot-load-size 4 \ + -boot-info-table + +ROOTFS_ISO9660_OPTS_EFI = \ + --efi-boot $(ROOTFS_ISO9660_EFI_PARTITION) \ -no-emul-boot -ifeq ($(BR2_TARGET_ROOTFS_ISO9660_BIOS_BOOTLOADER),y) +ifeq ($(BR2_TARGET_ROOTFS_ISO9660_BIOS_BOOTLOADER)$(BR2_TARGET_ROOTFS_ISO9660_EFI_BOOTLOADER),yy) ROOTFS_ISO9660_OPTS += \ - -boot-load-size 4 \ - -boot-info-table \ - -b $(ROOTFS_ISO9660_BOOT_IMAGE) -endif - -ifeq ($(BR2_TARGET_ROOTFS_ISO9660_EFI_BOOTLOADER),y) -ROOTFS_ISO9660_OPTS += \ - --efi-boot $(ROOTFS_ISO9660_EFI_PARTITION) + $(ROOTFS_ISO9660_OPTS_BIOS) \ + -eltorito-alt-boot \ + $(ROOTFS_ISO9660_OPTS_EFI) +else ifeq ($(BR2_TARGET_ROOTFS_ISO9660_BIOS_BOOTLOADER),y) +ROOTFS_ISO9660_OPTS += $(ROOTFS_ISO9660_OPTS_BIOS) +else ifeq ($(BR2_TARGET_ROOTFS_ISO9660_EFI_BOOTLOADER),y) +ROOTFS_ISO9660_OPTS += $(ROOTFS_ISO9660_OPTS_EFI) endif define ROOTFS_ISO9660_CMD