Skip to contentSkip to conversation

fs/iso9660, grub2 : grub-eltorito.img not found during the generation of rootfs.iso9660

Buildroot New arnaud.miche at orange.com 5 participants 6 messages Feb 28, 2017 – Mar 2, 2017

lore
Share & tools
lore
#0 lore raw

Hi everybody,

I am trying Buildroot_2016.11.2 and I have an issue during the generation of an iso rootfs.

My target is an "x86-64-efi" system.

The error is the following one :
===================

Quoted 1 line
Quoted 1 line
Quoted 1 line

Generating root filesystem image rootfs.iso9660

/usr/bin/install -D -m 0644 fs/iso9660/grub.cfg /home/arnaud/Developments/Projects/Linux_Firmware/Buildroot_2016.11.2/buildroot-2016.11.2/output/build/rootfs.iso9660.tmp/boot/grub/grub.cfg
/bin/sed -i -e "s%__KERNEL_PATH__%/boot/bzImage%" /home/arnaud/Developments/Projects/Linux_Firmware/Buildroot_2016.11.2/buildroot-2016.11.2/output/build/rootfs.iso9660.tmp/boot/grub/grub.cfg
/usr/bin/install -D -m 0644 /home/arnaud/Developments/Projects/Linux_Firmware/Buildroot_2016.11.2/buildroot-2016.11.2/output/images/grub-eltorito.img /home/arnaud/Developments/Projects/Linux_Firmware/Buildroot_2016.11.2/buildroot-2016.11.2/output/build/rootfs.iso9660.tmp/boot/grub/grub-eltorito.img /usr/bin/install: impossible d'?valuer ? /home/arnaud/Developments/Projects/Linux_Firmware/Buildroot_2016.11.2/buildroot-2016.11.2/output/images/grub-eltorito.img ?: Aucun fichier ou dossier de ce type
fs/iso9660/iso9660.mk:160: recipe for target '/home/arnaud/Developments/Projects/Linux_Firmware/Buildroot_2016.11.2/buildroot-2016.11.2/output/images/rootfs.iso9660' failed
make: *** [/home/arnaud/Developments/Projects/Linux_Firmware/Buildroot_2016.11.2/buildroot-2016.11.2/output/images/rootfs.iso9660] Error 1

If I check the makefile for Grub2, I find that the grub-eltorito.img file is created for only i386_pc target. See boot/grub2.mk, lines 80 to 85.

ifeq ($(BR2_TARGET_GRUB2_I386_PC),y)
define GRUB2_IMAGE_INSTALL_ELTORITO

    cat $(HOST_DIR)/usr/lib/grub/$(GRUB2_TUPLE)/cdboot.img $(GRUB2_IMAGE) > \
        $(BINARIES_DIR)/grub-eltorito.img

endef
endif

But in iso9660.mk, the only condition for installing grub-eltorito.img is the use of rootfs_iso9660_grub2 as seen lines 56 to 64 :

else ifeq ($(BR2_TARGET_ROOTFS_ISO9660_GRUB2),y)
ROOTFS_ISO9660_DEPENDENCIES += grub2

ROOTFS_ISO9660_BOOTLOADER_CONFIG_PATH = \
    $(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/grub.cfg
ROOTFS_ISO9660_BOOT_IMAGE = boot/grub/grub-eltorito.img
define ROOTFS_ISO9660_INSTALL_BOOTLOADER
    $(INSTALL) -D -m 0644 $(BINARIES_DIR)/grub-eltorito.img \
        $(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/grub-eltorito.img

endef

Is it a bug ? Or I misunderstood anything ?

If it is a bug, I lack some informations for patching my own installation with a convenient manner :

Is grub-eltorito.img still relevant when using Grub2 ?
If yes, should grub-eltorito.img be just built with i386_pc ? Must I have to add x86_64_efi target ?

Thank you a lot for your responses.

Arnaud

_________________________________________________________________________________________________________________________

Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration, Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.

This message and its attachments may contain confidential or privileged information that may be protected by law; they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete this message and its attachments. As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified. Thank you.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20170228/96df862e/attachment.html>

#1 lore raw

Hi Arnaud,

Quoted 49 lines · arnaud.miche at orange.com

Hi everybody,

I am trying Buildroot_2016.11.2 and I have an issue during the generation of an iso rootfs.

My target is an "x86-64-efi" system.

The error is the following one :
===================

*>>> Generating root filesystem image rootfs.iso9660
/usr/bin/install -D -m 0644 fs/iso9660/grub.cfg /home/arnaud/Developments/Projects/Linux_Firmware/Buildroot_2016.11.2/buildroot-2016.11.2/output/build/rootfs.iso9660.tmp/boot/grub/grub.cfg /bin/sed -i -e "s%__KERNEL_PATH__%/boot/bzImage%" /home/arnaud/Developments/Projects/Linux_Firmware/Buildroot_2016.11.2/buildroot-2016.11.2/output/build/rootfs.iso9660.tmp/boot/grub/grub.cfg /usr/bin/install -D -m 0644 /home/arnaud/Developments/Projects/Linux_Firmware/Buildroot_2016.11.2/buildroot-2016.11.2/output/images/grub-eltorito.img /home/arnaud/Developments/Projects/Linux_Firmware/Buildroot_2016.11.2/buildroot-2016.11.2/output/build/rootfs.iso9660.tmp/boot/grub/grub-eltorito.img /usr/bin/install: impossible d'?valuer
? /home/arnaud/Developments/Projects/Linux_Firmware/Buildroot_2016.11.2/buildroot-2016.11.2/output/images/grub-eltorito.img ?:
Aucun fichier ou dossier de ce type
fs/iso9660/iso9660.mk:160: recipe for target '/home/arnaud/Developments/Projects/Linux_Firmware/Buildroot_2016.11.2/buildroot-2016.11.2/output/images/rootfs.iso9660' failed
make: *** [/home/arnaud/Developments/Projects/Linux_Firmware/Buildroot_2016.11.2/buildroot-2016.11.2/output/images/rootfs.iso9660] Error 1*

If I check the makefile for Grub2, I find that the grub-eltorito.img file is created for only i386_pc target. See boot/grub2.mk, lines 80 to 85.

*ifeq ($(BR2_TARGET_GRUB2_I386_PC),y)
define GRUB2_IMAGE_INSTALL_ELTORITO

    cat $(HOST_DIR)/usr/lib/grub/$(GRUB2_TUPLE)/cdboot.img $(GRUB2_IMAGE) > \
        $(BINARIES_DIR)/grub-eltorito.img

endef
endif*

But in iso9660.mk, the only condition for installing grub-eltorito.img is the use of rootfs_iso9660_grub2 as seen lines 56 to 64 :

*else ifeq ($(BR2_TARGET_ROOTFS_ISO9660_GRUB2),y)
ROOTFS_ISO9660_DEPENDENCIES += grub2

ROOTFS_ISO9660_BOOTLOADER_CONFIG_PATH = \
    $(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/grub.cfg
ROOTFS_ISO9660_BOOT_IMAGE = boot/grub/grub-eltorito.img
define ROOTFS_ISO9660_INSTALL_BOOTLOADER
    $(INSTALL) -D -m 0644 $(BINARIES_DIR)/grub-eltorito.img \
        $(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/grub-eltorito.img
Quoted 3 lines

endef

*Is it a bug ? Or I misunderstood anything ?

Yes, this is a bug. iso9660 support in Buildroot is not used a lot so it tends
to be brittle.

Quoted 4 lines

If it is a bug, I lack some informations for patching my own installation with a convenient manner :

Is grub-eltorito.img still relevant when using Grub2 ?

It certainly is.

Quoted 2 lines

If yes, should grub-eltorito.img be just built with i386_pc ? Must I have to add x86_64_efi target ?

As I understand it, the eltorito-style bootable CDROM only makes sense with
legacy BIOS (i.e. i386-pc). For EFI, I think you need to add an addition (FAT?) filesystem track to the iso image. You can read up on it on [1].

The simplest solution is to limit the iso9660 grub2 support to i386-pc.

The proper solution is to add EFI support to iso9660.mk. But that requires more
investigation.

I'll send a patch implementing the first solution.

Regards,
Arnout

[1] http://wiki.osdev.org/El-Torito

Quoted 25 lines

Thank you a lot for your responses.

Arnaud

_________________________________________________________________________________________________________________________

Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration, Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.

This message and its attachments may contain confidential or privileged information that may be protected by law; they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete this message and its attachments. As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified. Thank you.

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#2 lore raw

PATCH 1/1 fs/iso9660: doesn't support (grub2) EFI

The iso9660 generation for grub2 assumes that grub-eltorito.img is available. However, this image is only available for the i386-pc target (i.e. legacy BIOS). An EFI-bootable iso9660 requires a different layout.

Since we currently can't generate the EFI-bootable iso9660 layout, require the i386-pc target to be selected in grub.

Reported-by arnaud.miche at orange.com
---
 fs/iso9660/Config.in | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
fs/iso9660/Config.in +4 -4
index 2482e44e31..d162586f38 100644
@@ -3,7 +3,7 @@ config BR2_TARGET_ROOTFS_ISO9660
 	depends on (BR2_i386 || BR2_x86_64)
 	depends on BR2_LINUX_KERNEL
 	depends on BR2_TARGET_GRUB || \
-		BR2_TARGET_GRUB2 || \
+		BR2_TARGET_GRUB2_I386_PC || \
 		BR2_TARGET_SYSLINUX_ISOLINUX
 	select BR2_LINUX_KERNEL_INSTALL_TARGET \
 	       if (!BR2_TARGET_ROOTFS_ISO9660_INITRD && !BR2_TARGET_ROOTFS_INITRAMFS)
@@ -33,7 +33,7 @@ config BR2_TARGET_ROOTFS_ISO9660_GRUB
 
 config BR2_TARGET_ROOTFS_ISO9660_GRUB2
 	bool "grub2"
-	depends on BR2_TARGET_GRUB2
+	depends on BR2_TARGET_GRUB2_I386_PC
 	help
 	  Use Grub 2 as the bootloader for the ISO9660 image. Make
 	  sure to enable the 'iso9660' module in
@@ -82,7 +82,7 @@ config BR2_TARGET_ROOTFS_ISO9660_HYBRID
 
 endif
 
-comment "iso image needs a Linux kernel and one of grub, grub2 or isolinux to be built"
+comment "iso image needs a Linux kernel and one of grub, grub2 i386-pc or isolinux to be built"
 	depends on BR2_i386 || BR2_x86_64
 	depends on !BR2_LINUX_KERNEL || \
-		!(BR2_TARGET_GRUB || BR2_TARGET_GRUB2 || BR2_TARGET_SYSLINUX_ISOLINUX)
+		!(BR2_TARGET_GRUB || BR2_TARGET_GRUB2_I386_PC || BR2_TARGET_SYSLINUX_ISOLINUX)
Signature · 1 line
2.11.0
#3 lore raw

PATCH 1/1 fs/iso9660: doesn't support (grub2) EFI

Arnout, All,

On 2017-03-01 21:05 +0100, Arnout Vandecappelle (Essensium/Mind) spake thusly:

Quoted 9 lines

The iso9660 generation for grub2 assumes that grub-eltorito.img is available. However, this image is only available for the i386-pc target (i.e. legacy BIOS). An EFI-bootable iso9660 requires a different layout.

Since we currently can't generate the EFI-bootable iso9660 layout, require the i386-pc target to be selected in grub.

Reported-by arnaud.miche at orange.com

Regards,
Yann E. MORIN.

Quoted 43 lines
---
 fs/iso9660/Config.in | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
fs/iso9660/Config.in +4 -4
index 2482e44e31..d162586f38 100644
@@ -3,7 +3,7 @@ config BR2_TARGET_ROOTFS_ISO9660
 	depends on (BR2_i386 || BR2_x86_64)
 	depends on BR2_LINUX_KERNEL
 	depends on BR2_TARGET_GRUB || \
-		BR2_TARGET_GRUB2 || \
+		BR2_TARGET_GRUB2_I386_PC || \
 		BR2_TARGET_SYSLINUX_ISOLINUX
 	select BR2_LINUX_KERNEL_INSTALL_TARGET \
 	       if (!BR2_TARGET_ROOTFS_ISO9660_INITRD && !BR2_TARGET_ROOTFS_INITRAMFS)
@@ -33,7 +33,7 @@ config BR2_TARGET_ROOTFS_ISO9660_GRUB
 
 config BR2_TARGET_ROOTFS_ISO9660_GRUB2
 	bool "grub2"
-	depends on BR2_TARGET_GRUB2
+	depends on BR2_TARGET_GRUB2_I386_PC
 	help
 	  Use Grub 2 as the bootloader for the ISO9660 image. Make
 	  sure to enable the 'iso9660' module in
@@ -82,7 +82,7 @@ config BR2_TARGET_ROOTFS_ISO9660_HYBRID
 
 endif
 
-comment "iso image needs a Linux kernel and one of grub, grub2 or isolinux to be built"
+comment "iso image needs a Linux kernel and one of grub, grub2 i386-pc or isolinux to be built"
 	depends on BR2_i386 || BR2_x86_64
 	depends on !BR2_LINUX_KERNEL || \
-		!(BR2_TARGET_GRUB || BR2_TARGET_GRUB2 || BR2_TARGET_SYSLINUX_ISOLINUX)
+		!(BR2_TARGET_GRUB || BR2_TARGET_GRUB2_I386_PC || BR2_TARGET_SYSLINUX_ISOLINUX)
Signature · 6 lines
2.11.0

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#4 lore raw

PATCH 1/1 fs/iso9660: doesn't support (grub2) EFI

In reply to Arnout Vandecappelle (Essensium/Mind)

Hello,

Quoted 4 lines · Arnout Vandecappelle (Essensium/Mind)

The iso9660 generation for grub2 assumes that grub-eltorito.img is available. However, this image is only available for the i386-pc target (i.e. legacy BIOS). An EFI-bootable iso9660 requires a different layout.

Quoted 8 lines

Since we currently can't generate the EFI-bootable iso9660 layout, require the i386-pc target to be selected in grub.

Reported-by arnaud.miche at orange.com
---
 fs/iso9660/Config.in | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Applied to master, thanks. Peter, I believe this one qualifies for the LTS branch.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#5 lore raw

PATCH 1/1 fs/iso9660: doesn't support (grub2) EFI

Quoted 12 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Hello,

Quoted 7 lines · Arnout Vandecappelle (Essensium/Mind)

The iso9660 generation for grub2 assumes that grub-eltorito.img is available. However, this image is only available for the i386-pc target (i.e. legacy BIOS). An EFI-bootable iso9660 requires a different layout.

Since we currently can't generate the EFI-bootable iso9660 layout, require the i386-pc target to be selected in grub.

Quoted 8 lines
Quoted 5 lines
Reported-by arnaud.miche at orange.com

---
fs/iso9660/Config.in | 8 ++++----

1 file changed, 4 insertions(+), 4 deletions(-)

Applied to master, thanks. Peter, I believe this one qualifies for the LTS branch.

Committed to 2017.02.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard