Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] fs/iso9660, grub2 : grub-eltorito.img not found during the generation of rootfs.iso9660
@ 2017-02-28 17:14 arnaud.miche at orange.com
  2017-03-01 19:59 ` Arnout Vandecappelle
  0 siblings, 1 reply; 6+ messages in thread
From: arnaud.miche at orange.com @ 2017-02-28 17:14 UTC (permalink / raw)
  To: buildroot

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
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>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] fs/iso9660, grub2 : grub-eltorito.img not found during the generation of rootfs.iso9660
  2017-02-28 17:14 [Buildroot] fs/iso9660, grub2 : grub-eltorito.img not found during the generation of rootfs.iso9660 arnaud.miche at orange.com
@ 2017-03-01 19:59 ` Arnout Vandecappelle
  2017-03-01 20:05   ` [Buildroot] [PATCH] fs/iso9660: doesn't support (grub2) EFI Arnout Vandecappelle
  0 siblings, 1 reply; 6+ messages in thread
From: Arnout Vandecappelle @ 2017-03-01 19:59 UTC (permalink / raw)
  To: buildroot

 Hi Arnaud,

On 28-02-17 18:14, arnaud.miche at orange.com wrote:
> 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
> 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.


> 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.

> 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

> 
> 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
> 

-- 
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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH] fs/iso9660: doesn't support (grub2) EFI
  2017-03-01 19:59 ` Arnout Vandecappelle
@ 2017-03-01 20:05   ` Arnout Vandecappelle
  2017-03-01 20:21     ` Yann E. MORIN
  2017-03-01 20:54     ` Thomas Petazzoni
  0 siblings, 2 replies; 6+ messages in thread
From: Arnout Vandecappelle @ 2017-03-01 20:05 UTC (permalink / raw)
  To: buildroot

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.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Reported-by: arnaud.miche at orange.com
---
 fs/iso9660/Config.in | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/iso9660/Config.in b/fs/iso9660/Config.in
index 2482e44e31..d162586f38 100644
--- a/fs/iso9660/Config.in
+++ b/fs/iso9660/Config.in
@@ -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)
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH] fs/iso9660: doesn't support (grub2) EFI
  2017-03-01 20:05   ` [Buildroot] [PATCH] fs/iso9660: doesn't support (grub2) EFI Arnout Vandecappelle
@ 2017-03-01 20:21     ` Yann E. MORIN
  2017-03-01 20:54     ` Thomas Petazzoni
  1 sibling, 0 replies; 6+ messages in thread
From: Yann E. MORIN @ 2017-03-01 20:21 UTC (permalink / raw)
  To: buildroot

Arnout, All,

On 2017-03-01 21:05 +0100, Arnout Vandecappelle (Essensium/Mind) spake thusly:
> 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.
> 
> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
> Reported-by: arnaud.miche at orange.com

Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

Regards,
Yann E. MORIN.

> ---
>  fs/iso9660/Config.in | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/iso9660/Config.in b/fs/iso9660/Config.in
> index 2482e44e31..d162586f38 100644
> --- a/fs/iso9660/Config.in
> +++ b/fs/iso9660/Config.in
> @@ -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)
> -- 
> 2.11.0
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH] fs/iso9660: doesn't support (grub2) EFI
  2017-03-01 20:05   ` [Buildroot] [PATCH] fs/iso9660: doesn't support (grub2) EFI Arnout Vandecappelle
  2017-03-01 20:21     ` Yann E. MORIN
@ 2017-03-01 20:54     ` Thomas Petazzoni
  2017-03-02  7:20       ` Peter Korsgaard
  1 sibling, 1 reply; 6+ messages in thread
From: Thomas Petazzoni @ 2017-03-01 20:54 UTC (permalink / raw)
  To: buildroot

Hello,

On Wed, 1 Mar 2017 21:05:42 +0100, Arnout Vandecappelle
(Essensium/Mind) wrote:
> 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.
> 
> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
> 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
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH] fs/iso9660: doesn't support (grub2) EFI
  2017-03-01 20:54     ` Thomas Petazzoni
@ 2017-03-02  7:20       ` Peter Korsgaard
  0 siblings, 0 replies; 6+ messages in thread
From: Peter Korsgaard @ 2017-03-02  7:20 UTC (permalink / raw)
  To: buildroot

>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:

 > Hello,
 > On Wed, 1 Mar 2017 21:05:42 +0100, Arnout Vandecappelle
 > (Essensium/Mind) wrote:
 >> 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.
 >> 
 >> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
 >> 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.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-03-02  7:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-28 17:14 [Buildroot] fs/iso9660, grub2 : grub-eltorito.img not found during the generation of rootfs.iso9660 arnaud.miche at orange.com
2017-03-01 19:59 ` Arnout Vandecappelle
2017-03-01 20:05   ` [Buildroot] [PATCH] fs/iso9660: doesn't support (grub2) EFI Arnout Vandecappelle
2017-03-01 20:21     ` Yann E. MORIN
2017-03-01 20:54     ` Thomas Petazzoni
2017-03-02  7:20       ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox