Skip to contentSkip to conversation

iso9660/grub improvements

PATCH New Thomas Petazzoni 2 participants 27 messages Dec 28, 2013 – Dec 29, 2013

lore
Share & tools
lore
#0 lore raw

cover iso9660/grub improvements

Hello,

Here is a set of commits that improves the iso9660/grub handling:

* Ensures that grub is built with the iso9660 support when the iso9660 image format has been selected.

* Add splashscreen support to Grub for the iso9660 image mechanism.

* Do not include the initrd into the filesystem if it is built into the kernel image itself.

* Related improvements/fixes

Thanks!

Thomas

Thierry Bultel (1):
fs/iso9660: do not use an initrd in iso image when using initramfs

Thomas Petazzoni (8):
fs/iso9660: put the Buildroot boot entry first in Grub menu.lst
grub: enclose network driver options in a sub-menu
grub: replace string option for filesystem selection by booleans fs/iso9660: select ISO9660 support in Grub
linux: enable initrd/initramfs support when cpio rootfs is chosen
grub: really disable splash screen support
fs/iso9660: add Grub splashscreen support
grub: align splashscreen handling with iso9660 code

 boot/grub/Config.in   | 48 ++++++++++++++++++++++++++++++++++++++++--------
 boot/grub/grub.mk     | 32 +++++++++++++++++++-------------
 boot/grub/menu.lst    | 11 +++++++----
 fs/iso9660/Config.in  |  1 +
 fs/iso9660/iso9660.mk |  9 +++++++++
 fs/iso9660/menu.lst   | 13 ++++++++-----
 linux/linux.mk        |  3 ++-
 7 files changed, 86 insertions(+), 31 deletions(-)
Signature · 1 line
1.8.3.2
#1 lore raw

PATCH 1/9 fs/iso9660: put the Buildroot boot entry first in Grub menu.lst

The ISO9660-specific Grub menu.lst contains two entries: one entry to chainload the bootloader available in the first hard drive, and another entry to boot the Buildroot system.

However, it defaults to booting the first entry, i.e chainloading what's on the first hard drive. For a Buildroot generated system, this is quite odd: we're not even booting the system built by Buildroot.

So, switch the two entries, and put the Buildroot boot entry first.

---
 fs/iso9660/menu.lst | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
fs/iso9660/menu.lst +4 -4
index d78caeb..ed7836a 100644
@@ -2,10 +2,10 @@ default		0
 timeout		10
 color cyan/blue white/blue
 
+title		Buildroot ISO9660 image
+kernel		/kernel
+initrd		/initrd
+
 title		Hard Drive (first partition)
 rootnoverify	(hd0)
 chainloader	+1
-
-title		BuildRoot ISO9660 image
-kernel		/kernel
-initrd		/initrd
Signature · 1 line
1.8.3.2
#2 lore raw

PATCH 1/9 fs/iso9660: put the Buildroot boot entry first in Grub menu.lst

Thomas, All,

On 2013-12-28 15:56 +0100, Thomas Petazzoni spake thusly:

Quoted 11 lines

The ISO9660-specific Grub menu.lst contains two entries: one entry to chainload the bootloader available in the first hard drive, and another entry to boot the Buildroot system.

However, it defaults to booting the first entry, i.e chainloading what's on the first hard drive. For a Buildroot generated system, this is quite odd: we're not even booting the system built by Buildroot.

So, switch the two entries, and put the Buildroot boot entry first.

Regards,
Yann E. MORIN.

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.  |
'------------------------------^-------^------------------^--------------------'
#3 lore raw

PATCH 2/9 grub: enclose network driver options in a sub-menu

In reply to Thomas Petazzoni

In preparation to a change to the configuration options of the supported filesystem in Grub, enclose the network driver options in a sub-menu.

---
 boot/grub/Config.in | 4 ++++
 1 file changed, 4 insertions(+)
boot/grub/Config.in +4 -0
index c90770f..c3a729f 100644
@@ -58,6 +58,8 @@ config BR2_TARGET_GRUB_DISKLESS
 	help
 	  enable diskless support
 
+menu "network drivers"
+
 config BR2_TARGET_GRUB_3c595
 	bool "3Com595 driver"
 	help
@@ -163,4 +165,6 @@ config BR2_TARGET_GRUB_w89c840
 	help
 	  enable Winbond W89c840 driver
 
+endmenu
+
 endif # BR2_TARGET_GRUB
Signature · 1 line
1.8.3.2
#4 lore raw

PATCH 2/9 grub: enclose network driver options in a sub-menu

Thomas, All,

On 2013-12-28 15:56 +0100, Thomas Petazzoni spake thusly:

Quoted 5 lines

In preparation to a change to the configuration options of the supported filesystem in Grub, enclose the network driver options in a sub-menu.

Regards,
Yann E. MORIN.

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.  |
'------------------------------^-------^------------------^--------------------'
#5 lore raw

PATCH 3/9 grub: replace string option for filesystem selection by booleans

In reply to Thomas Petazzoni

In 1cece2813bf635ae29e9a8287322439b9c5992f7 (grub: add option to configure the list of supported filesystems), we introduced the BR2_TARGET_GRUB_FS_SUPPORT option which allows to provide a space-separated list of filesystems that Grub should support.

However, it turns out that this not very practical, because the iso9660 filesystem logic in Buildroot should force the ISO9660 support to be enabled in Grub, which is not easy to do with a string option.

Therefore, this patch changes this option from a string option to a list of boolean option, one per filesystem supported.

A few useful details:

- Since Grub legacy is dead, the list of filesystem, and therefore the number of options, will not grow.

- We have only added options for filesystems that are likely to be used in an embedded Linux context. Filesystems such as VSTAfs, Minix, UFS2 or FFS2 are not supported.

- There is no need to add some Config.in.legacy support for the previous option, since it was added after Buildroot 2013.11, and was therefore never part of an official Buildroot release.

---
 boot/grub/Config.in | 44 ++++++++++++++++++++++++++++++++++++--------
 boot/grub/grub.mk   | 24 +++++++++++++-----------
 2 files changed, 49 insertions(+), 19 deletions(-)
boot/grub/Config.in +36 -8
index c3a729f..3ae8448 100644
@@ -45,19 +45,47 @@ config BR2_TARGET_GRUB_SPLASH
 	  A splashimage is a 14-color indexed .xpm picture which
 	  is displayed as background for the grub menu.
 
-config BR2_TARGET_GRUB_FS_SUPPORT
-	string "Filesystem to support"
-	default "ext2fs fat"
-	help
-	  Space separated list of filesystems to support. Possible
-	  values are ext2fs, fat, ffs, ufs2, minix, reiserfs, vstafs,
-	  jfs, xfs and iso9660.
-
 config BR2_TARGET_GRUB_DISKLESS
 	bool "diskless support"
 	help
 	  enable diskless support
 
+menu "filesystem drivers"
+
+config BR2_TARGET_GRUB_FS_EXT2
+	bool "ext2"
+	default y
+	help
+	  Enable support for the ext2 filesystem in Grub
+
+config BR2_TARGET_GRUB_FS_FAT
+	bool "FAT"
+	default y
+	help
+	  Enable support for the FAT filesystem in Grub.
+
+config BR2_TARGET_GRUB_FS_ISO9660
+	bool "ISO9660"
+	help
+	  Enable support for the ISO9660 filesystem in Grub.
+
+config BR2_TARGET_GRUB_FS_JFS
+	bool "IBM JFS"
+	help
+	  Enable support for the JFS filesystem in Grub.
+
+config BR2_TARGET_GRUB_FS_REISERFS
+	bool "ReiserFS"
+	help
+	  Enable support for the ReiserFS filesystem in Grub.
+
+config BR2_TARGET_GRUB_FS_XFS
+	bool "SGI XFS"
+	help
+	  Enable support for the XFS filesystem in Grub.
+
+endmenu
+
 menu "network drivers"
 
 config BR2_TARGET_GRUB_3c595
boot/grub/grub.mk +13 -11
index eb066af..43121ff 100644
@@ -46,18 +46,20 @@ GRUB_CONFIG-$(BR2_TARGET_GRUB_undi) += --enable-undi
 GRUB_CONFIG-$(BR2_TARGET_GRUB_via_rhine) += --enable-via-rhine
 GRUB_CONFIG-$(BR2_TARGET_GRUB_w89c840) += --enable-w89c840
 
-GRUB_POSSIBLE_FILESYSTEMS = ext2fs fat ffs ufs2 minix \
-	reiserfs vstafs jfs xfs iso9660
-GRUB_SELECTED_FILESYSTEMS = $(call qstrip,$(BR2_TARGET_GRUB_FS_SUPPORT))
+GRUB_CONFIG-y += $(if $(BR2_TARGET_GRUB_FS_EXT2),--enable-ext2fs,--disable-ext2fs)
+GRUB_CONFIG-y += $(if $(BR2_TARGET_GRUB_FS_FAT),--enable-fat,--disable-fat)
+GRUB_CONFIG-y += $(if $(BR2_TARGET_GRUB_FS_ISO9660),--enable-iso9660,--disable-iso9660)
+GRUB_CONFIG-y += $(if $(BR2_TARGET_GRUB_FS_JFS),--enable-jfs,--disable-jfs)
+GRUB_CONFIG-y += $(if $(BR2_TARGET_GRUB_FS_REISERFS),--enable-reiserfs,--disable-reiserfs)
+GRUB_CONFIG-y += $(if $(BR2_TARGET_GRUB_FS_XFS),--enable-xfs,--disable-xfs)
+GRUB_CONFIG-y += --disable-ffs --disable-ufs2 --disable-minix --disable-vstafs
 
-# Calculate the list of stage 1.5 files to install. They are prefixed
-# by the filesystem name, except for ext2fs, where the stage 1.5 is
-# prefixed by e2fs.
-GRUB_STAGE_1_5_TO_INSTALL = $(subst ext2fs,e2fs,$(GRUB_SELECTED_FILESYSTEMS))
-
-GRUB_CONFIG-y = \
-	$(foreach fs,$(GRUB_POSSIBLE_FILESYSTEMS),\
-		$(if $(filter $(fs),$(GRUB_SELECTED_FILESYSTEMS)),--enable-$(fs),--disable-$(fs)))
+GRUB_STAGE_1_5_TO_INSTALL += $(if $(BR2_TARGET_GRUB_FS_EXT2),e2fs)
+GRUB_STAGE_1_5_TO_INSTALL += $(if $(BR2_TARGET_GRUB_FS_FAT),fat)
+GRUB_STAGE_1_5_TO_INSTALL += $(if $(BR2_TARGET_GRUB_FS_ISO9660),iso9660)
+GRUB_STAGE_1_5_TO_INSTALL += $(if $(BR2_TARGET_GRUB_FS_JFS),jfs)
+GRUB_STAGE_1_5_TO_INSTALL += $(if $(BR2_TARGET_GRUB_FS_REISERFS),reiserfs)
+GRUB_STAGE_1_5_TO_INSTALL += $(if $(BR2_TARGET_GRUB_FS_XFS),xfs)
 
 define GRUB_DEBIAN_PATCHES
 	# Apply the patches from the Debian patch
Signature · 1 line
1.8.3.2
#6 lore raw

PATCH 3/9 grub: replace string option for filesystem selection by booleans

Thomas, All,

On 2013-12-28 15:56 +0100, Thomas Petazzoni spake thusly:

Quoted 21 lines

In 1cece2813bf635ae29e9a8287322439b9c5992f7 (grub: add option to configure the list of supported filesystems), we introduced the BR2_TARGET_GRUB_FS_SUPPORT option which allows to provide a space-separated list of filesystems that Grub should support.

However, it turns out that this not very practical, because the iso9660 filesystem logic in Buildroot should force the ISO9660 support to be enabled in Grub, which is not easy to do with a string option.

Therefore, this patch changes this option from a string option to a list of boolean option, one per filesystem supported.

A few useful details:

- Since Grub legacy is dead, the list of filesystem, and therefore the number of options, will not grow.

- We have only added options for filesystems that are likely to be used in an embedded Linux context. Filesystems such as VSTAfs, Minix, UFS2 or FFS2 are not supported.

Quoted 5 lines

- There is no need to add some Config.in.legacy support for the previous option, since it was added after Buildroot 2013.11, and was therefore never part of an official Buildroot release.

Regards,
Yann E. MORIN.

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.  |
'------------------------------^-------^------------------^--------------------'
#7 lore raw

PATCH 4/9 fs/iso9660: select ISO9660 support in Grub

In reply to Thomas Petazzoni

The fs/iso9660 logic assumes that the Grub bootloader is used. Therefore, it should make sure that Grub is configured with the support for the ISO9660 filesystem.

---
 fs/iso9660/Config.in | 1 +
 1 file changed, 1 insertion(+)
fs/iso9660/Config.in +1 -0
index 4c200c8..50b4377 100644
@@ -4,6 +4,7 @@ config BR2_TARGET_ROOTFS_ISO9660
 	depends on BR2_LINUX_KERNEL
 	select BR2_TARGET_ROOTFS_CPIO
 	select BR2_TARGET_GRUB
+	select BR2_TARGET_GRUB_FS_ISO9660
 	help
 	  Build a bootable iso9660 image
 
Signature · 1 line
1.8.3.2
#8 lore raw

PATCH 4/9 fs/iso9660: select ISO9660 support in Grub

Thomas, All,

On 2013-12-28 15:56 +0100, Thomas Petazzoni spake thusly:

Quoted 5 lines

The fs/iso9660 logic assumes that the Grub bootloader is used. Therefore, it should make sure that Grub is configured with the support for the ISO9660 filesystem.

Regards,
Yann E. MORIN.

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.  |
'------------------------------^-------^------------------^--------------------'
#9 lore raw

PATCH 5/9 linux: enable initrd/initramfs support when cpio rootfs is chosen

In reply to Thomas Petazzoni

When one enables the generation of a cpio archive of the root filesystem, the most likely usage is as an initramfs for the kernel. This commit ensures that the kernel has initramfs support when the rootfs cpio image format is chosen.

This will for example ensure that if the user selects the ISO9660 filesystem format (which uses a cpio initramfs), the kernel will have proper support to load and use the initramfs.

It is worth mentionning that when BR2_TARGET_ROOTFS_INITRAMFS is enabled, then BR2_TARGET_ROOTFS_CPIO is always enabled. That's why we move the enabling of CONFIG_BLK_DEV_INITRD from the initramfs case to the cpio case.

---
 linux/linux.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
linux/linux.mk +2 -1
index 5af167d..fa8aa0c 100644
@@ -169,13 +169,14 @@ define LINUX_CONFIGURE_CMDS
 	rm $(KERNEL_ARCH_PATH)/configs/buildroot_defconfig
 	$(if $(BR2_arm)$(BR2_armeb),
 		$(call KCONFIG_ENABLE_OPT,CONFIG_AEABI,$(@D)/.config))
+	$(if $(BR2_TARGET_ROOTFS_CPIO),
+		$(call KCONFIG_ENABLE_OPT,CONFIG_BLK_DEV_INITRD,$(@D)/.config))
 	# As the kernel gets compiled before root filesystems are
 	# built, we create a fake cpio file. It'll be
 	# replaced later by the real cpio archive, and the kernel will be
 	# rebuilt using the linux26-rebuild-with-initramfs target.
 	$(if $(BR2_TARGET_ROOTFS_INITRAMFS),
 		touch $(BINARIES_DIR)/rootfs.cpio
-		$(call KCONFIG_ENABLE_OPT,CONFIG_BLK_DEV_INITRD,$(@D)/.config)
 		$(call KCONFIG_SET_OPT,CONFIG_INITRAMFS_SOURCE,\"$(BINARIES_DIR)/rootfs.cpio\",$(@D)/.config)
 		$(call KCONFIG_SET_OPT,CONFIG_INITRAMFS_ROOT_UID,0,$(@D)/.config)
 		$(call KCONFIG_SET_OPT,CONFIG_INITRAMFS_ROOT_GID,0,$(@D)/.config))
Signature · 1 line
1.8.3.2
#10 lore raw

PATCH 5/9 linux: enable initrd/initramfs support when cpio rootfs is chosen

Thomas, All,

On 2013-12-28 15:56 +0100, Thomas Petazzoni spake thusly:

Quoted 5 lines

When one enables the generation of a cpio archive of the root filesystem, the most likely usage is as an initramfs for the kernel. This commit ensures that the kernel has initramfs support when the rootfs cpio image format is chosen.

Quoted 8 lines

This will for example ensure that if the user selects the ISO9660 filesystem format (which uses a cpio initramfs), the kernel will have proper support to load and use the initramfs.

It is worth mentionning that when BR2_TARGET_ROOTFS_INITRAMFS is enabled, then BR2_TARGET_ROOTFS_CPIO is always enabled. That's why we move the enabling of CONFIG_BLK_DEV_INITRD from the initramfs case to the cpio case.

Do we even want to expose cpio in the first place?

The way I see it:
- if someone wants an archive, then a tarball is a more common archive type than cpio is, so we need not expose cpio. If the user wants an archive, then he should just use a tarball.
- thus, as cpio is just a requirement for initramfs, there is no reason to expose cpio in the menu, and just merge cpio as a internal step of initramfs

Quoted 32 lines
---
 linux/linux.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
linux/linux.mk +2 -1
index 5af167d..fa8aa0c 100644
@@ -169,13 +169,14 @@ define LINUX_CONFIGURE_CMDS
 	rm $(KERNEL_ARCH_PATH)/configs/buildroot_defconfig
 	$(if $(BR2_arm)$(BR2_armeb),
 		$(call KCONFIG_ENABLE_OPT,CONFIG_AEABI,$(@D)/.config))
+	$(if $(BR2_TARGET_ROOTFS_CPIO),
+		$(call KCONFIG_ENABLE_OPT,CONFIG_BLK_DEV_INITRD,$(@D)/.config))
 	# As the kernel gets compiled before root filesystems are
 	# built, we create a fake cpio file. It'll be
 	# replaced later by the real cpio archive, and the kernel will be
 	# rebuilt using the linux26-rebuild-with-initramfs target.
 	$(if $(BR2_TARGET_ROOTFS_INITRAMFS),
 		touch $(BINARIES_DIR)/rootfs.cpio
-		$(call KCONFIG_ENABLE_OPT,CONFIG_BLK_DEV_INITRD,$(@D)/.config)
 		$(call KCONFIG_SET_OPT,CONFIG_INITRAMFS_SOURCE,\"$(BINARIES_DIR)/rootfs.cpio\",$(@D)/.config)
 		$(call KCONFIG_SET_OPT,CONFIG_INITRAMFS_ROOT_UID,0,$(@D)/.config)
 		$(call KCONFIG_SET_OPT,CONFIG_INITRAMFS_ROOT_GID,0,$(@D)/.config))
Signature · 6 lines
1.8.3.2

_______________________________________________
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.  |
'------------------------------^-------^------------------^--------------------'
#11 lore raw

PATCH 5/9 linux: enable initrd/initramfs support when cpio rootfs is chosen

Dear Yann E. MORIN,

Quoted 9 lines · Yann E. MORIN

Do we even want to expose cpio in the first place?

The way I see it:
- if someone wants an archive, then a tarball is a more common archive type than cpio is, so we need not expose cpio. If the user wants an archive, then he should just use a tarball.
- thus, as cpio is just a requirement for initramfs, there is no reason to expose cpio in the menu, and just merge cpio as a internal step of initramfs

I am using the cpio format, exposed by Buildroot, on a daily basis. My use case is that I do a lot of kernel development. I do use Buildroot to generate a rootfs.cpio, but I build my kernel separately (because I'm rebuilding it many 50-100 times a day). And I simply point my kernel configuration to the Buildroot rootfs.cpio:

~/projets/marvell/mvebu$ grep INITRAMFS_SOURCE .config CONFIG_INITRAMFS_SOURCE="../rootfs-armv7/images/rootfs.cpio"

So yes, I *really* want to keep the cpio format option :-)

Thanks!

Thomas

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

PATCH 5/9 linux: enable initrd/initramfs support when cpio rootfs is chosen

Thomas, All,

On 2013-12-29 11:13 +0100, Thomas Petazzoni spake thusly:

Quoted 18 lines · Yann E. MORIN
Quoted 10 lines

Do we even want to expose cpio in the first place?

The way I see it:
- if someone wants an archive, then a tarball is a more common archive type than cpio is, so we need not expose cpio. If the user wants an archive, then he should just use a tarball.
- thus, as cpio is just a requirement for initramfs, there is no reason to expose cpio in the menu, and just merge cpio as a internal step of initramfs

I am using the cpio format, exposed by Buildroot, on a daily basis. My use case is that I do a lot of kernel development. I do use Buildroot to generate a rootfs.cpio, but I build my kernel separately (because I'm rebuilding it many 50-100 times a day). And I simply point my kernel configuration to the Buildroot rootfs.cpio:

Quoted 4 lines

~/projets/marvell/mvebu$ grep INITRAMFS_SOURCE .config CONFIG_INITRAMFS_SOURCE="../rootfs-armv7/images/rootfs.cpio"

So yes, I *really* want to keep the cpio format option :-)

Ah, OK, that's indeed a valid use-case. I had forgotten about externally-built kernels.

But then, unless you're building without modules, you'd have to rebuild your rootfs.cpio everytime you rebuild your kernel, no?

Regards,
Yann E. MORIN.

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.  |
'------------------------------^-------^------------------^--------------------'
#13 lore raw

PATCH 5/9 linux: enable initrd/initramfs support when cpio rootfs is chosen

Dear Yann E. MORIN,

Quoted 10 lines · Yann E. MORIN
Quoted 4 lines

~/projets/marvell/mvebu$ grep INITRAMFS_SOURCE .config CONFIG_INITRAMFS_SOURCE="../rootfs-armv7/images/rootfs.cpio"

So yes, I *really* want to keep the cpio format option :-)

Ah, OK, that's indeed a valid use-case. I had forgotten about externally-built kernels.

But then, unless you're building without modules, you'd have to rebuild your rootfs.cpio everytime you rebuild your kernel, no?

I will my kernel without modules, indeed.

Thanks!

Thomas

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

PATCH 6/9 fs/iso9660: do not use an initrd in iso image when using initramfs

In reply to Thomas Petazzoni

From: Thierry Bultel <[email protected]>

When using initramfs built into the kernel, it is useless to put an initrd in the iso image. This patch makes the image to only contain the kernel image, and also removes the initrd line from menu.lst

---
 fs/iso9660/iso9660.mk | 4 ++++
 1 file changed, 4 insertions(+)
fs/iso9660/iso9660.mk +4 -0
index 979a0b2..56e87bb 100644
@@ -17,7 +17,11 @@ $(BINARIES_DIR)/rootfs.iso9660: host-cdrkit host-fakeroot linux rootfs-cpio grub
 	cp $(GRUB_DIR)/stage2/stage2_eltorito $(ISO9660_TARGET_DIR)/boot/grub/
 	cp $(ISO9660_BOOT_MENU) $(ISO9660_TARGET_DIR)/boot/grub/menu.lst
 	cp $(LINUX_IMAGE_PATH) $(ISO9660_TARGET_DIR)/kernel
+ifeq ($(BR2_TARGET_ROOTFS_INITRAMFS),y)
+	$(SED) '/initrd/d'  $(ISO9660_TARGET_DIR)/boot/grub/menu.lst
+else
 	cp $(BINARIES_DIR)/rootfs.cpio$(ROOTFS_CPIO_COMPRESS_EXT) $(ISO9660_TARGET_DIR)/initrd
+endif
 	# Use fakeroot to pretend all target binaries are owned by root
 	rm -f $(FAKEROOT_SCRIPT)
 	echo "chown -R 0:0 $(ISO9660_TARGET_DIR)" >> $(FAKEROOT_SCRIPT)
Signature · 1 line
1.8.3.2
#15 lore raw

PATCH 7/9 grub: really disable splash screen support

In reply to Thomas Petazzoni

When BR2_TARGET_GRUB_SPLASH is enabled, we were passing --enable-graphics, but when it was disabled, we were not doing anything. However, in Grub, graphics support is enabled by default, and you have to pass --disable-graphics to disable it.

Fix this by passing --enable-graphics or --disable-graphics as appropriate.

---
 boot/grub/grub.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
boot/grub/grub.mk +2 -1
index 43121ff..3be4a74 100644
@@ -22,7 +22,8 @@ GRUB_CFLAGS = \
 	-O0 -Wl,--build-id=none \
 	-fno-stack-protector
 
-GRUB_CONFIG-$(BR2_TARGET_GRUB_SPLASH) += --enable-graphics
+GRUB_CONFIG-y += $(if $(BR2_TARGET_GRUB_SPLASH),--enable-graphics,--disable-graphics)
+
 GRUB_CONFIG-$(BR2_TARGET_GRUB_DISKLESS) += --enable-diskless
 GRUB_CONFIG-$(BR2_TARGET_GRUB_3c595) += --enable-3c595
 GRUB_CONFIG-$(BR2_TARGET_GRUB_3c90x) += --enable-3c90x
Signature · 1 line
1.8.3.2
#16 lore raw

PATCH 7/9 grub: really disable splash screen support

Thomas, All,

On 2013-12-28 15:56 +0100, Thomas Petazzoni spake thusly:

Quoted 9 lines

When BR2_TARGET_GRUB_SPLASH is enabled, we were passing --enable-graphics, but when it was disabled, we were not doing anything. However, in Grub, graphics support is enabled by default, and you have to pass --disable-graphics to disable it.

Fix this by passing --enable-graphics or --disable-graphics as appropriate.

Regards,
Yann E. MORIN.

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.  |
'------------------------------^-------^------------------^--------------------'
#17 lore raw

PATCH 8/9 fs/iso9660: add Grub splashscreen support

In reply to Thomas Petazzoni

When Grub is built with splashscreen support, copy the splashscreen image to the ISO9660 filesystem. Otherwise, disable the splashscreen in the grub menu.lst file.

---
 fs/iso9660/iso9660.mk | 5 +++++
 fs/iso9660/menu.lst   | 5 ++++-
 2 files changed, 9 insertions(+), 1 deletion(-)
fs/iso9660/iso9660.mk +5 -0
index 56e87bb..0260d41 100644
@@ -16,6 +16,11 @@ $(BINARIES_DIR)/rootfs.iso9660: host-cdrkit host-fakeroot linux rootfs-cpio grub
 	mkdir -p $(ISO9660_TARGET_DIR)/boot/grub
 	cp $(GRUB_DIR)/stage2/stage2_eltorito $(ISO9660_TARGET_DIR)/boot/grub/
 	cp $(ISO9660_BOOT_MENU) $(ISO9660_TARGET_DIR)/boot/grub/menu.lst
+ifeq ($(BR2_TARGET_GRUB_SPLASH),)
+	$(SED) '/splashimage/d' $(ISO9660_TARGET_DIR)/boot/grub/menu.lst
+else
+	cp boot/grub/splash.xpm.gz $(ISO9660_TARGET_DIR)/
+endif
 	cp $(LINUX_IMAGE_PATH) $(ISO9660_TARGET_DIR)/kernel
 ifeq ($(BR2_TARGET_ROOTFS_INITRAMFS),y)
 	$(SED) '/initrd/d'  $(ISO9660_TARGET_DIR)/boot/grub/menu.lst
fs/iso9660/menu.lst +4 -1
index ed7836a..b1ba3c9 100644
@@ -1,6 +1,9 @@
 default		0
 timeout		10
-color cyan/blue white/blue
+color 		cyan/blue white/blue
+splashimage	/splash.xpm.gz
+foreground 	000000
+background 	cccccc
 
 title		Buildroot ISO9660 image
 kernel		/kernel
Signature · 1 line
1.8.3.2
#18 lore raw

PATCH 8/9 fs/iso9660: add Grub splashscreen support

Thomas, All,

On 2013-12-28 15:56 +0100, Thomas Petazzoni spake thusly:

Quoted 31 lines

When Grub is built with splashscreen support, copy the splashscreen image to the ISO9660 filesystem. Otherwise, disable the splashscreen in the grub menu.lst file.

---
 fs/iso9660/iso9660.mk | 5 +++++
 fs/iso9660/menu.lst   | 5 ++++-
 2 files changed, 9 insertions(+), 1 deletion(-)
fs/iso9660/iso9660.mk +5 -0
index 56e87bb..0260d41 100644
@@ -16,6 +16,11 @@ $(BINARIES_DIR)/rootfs.iso9660: host-cdrkit host-fakeroot linux rootfs-cpio grub
 	mkdir -p $(ISO9660_TARGET_DIR)/boot/grub
 	cp $(GRUB_DIR)/stage2/stage2_eltorito $(ISO9660_TARGET_DIR)/boot/grub/
 	cp $(ISO9660_BOOT_MENU) $(ISO9660_TARGET_DIR)/boot/grub/menu.lst
+ifeq ($(BR2_TARGET_GRUB_SPLASH),)
+	$(SED) '/splashimage/d' $(ISO9660_TARGET_DIR)/boot/grub/menu.lst
+else
+	cp boot/grub/splash.xpm.gz $(ISO9660_TARGET_DIR)/
+endif
 	cp $(LINUX_IMAGE_PATH) $(ISO9660_TARGET_DIR)/kernel
 ifeq ($(BR2_TARGET_ROOTFS_INITRAMFS),y)
 	$(SED) '/initrd/d'  $(ISO9660_TARGET_DIR)/boot/grub/menu.lst
fs/iso9660/menu.lst +0 -0
index ed7836a..b1ba3c9 100644

fs/iso9660/menu.lst line 6

Quoted 7 lines
fs/iso9660/menu.lst +4 -1
@@ -1,6 +1,9 @@
 default		0
 timeout		10
-color cyan/blue white/blue
+color 		cyan/blue white/blue
+splashimage	/splash.xpm.gz
+foreground 	000000
+background 	cccccc

'foreground' and 'background' do not seem to be valid grub-legacy or grub-2 options, at least according to their respective documentations:
- grub-legacy (aka grub-0.9x):
http://www.gnu.org/software/grub/manual/legacy/grub.html#color
- grub-2:
http://www.gnu.org/software/grub/manual/grub.html#Theme-File-Manual

Regards,
Yann E. MORIN.

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.  |
'------------------------------^-------^------------------^--------------------'
#19 lore raw

PATCH 8/9 fs/iso9660: add Grub splashscreen support

Dear Yann E. MORIN,

Quoted 11 lines · Yann E. MORIN
Quoted 11 lines
fs/iso9660/menu.lst +3 -1
index ed7836a..b1ba3c9 100644
@@ -1,6 +1,9 @@
 default		0
 timeout		10
-color cyan/blue white/blue
+color 		cyan/blue white/blue
+splashimage	/splash.xpm.gz
+foreground 	000000
Quoted 8 lines

fs/iso9660/menu.lst line 6

Quoted 1 line
fs/iso9660/menu.lst +1 -0
+background 	cccccc

'foreground' and 'background' do not seem to be valid grub-legacy or grub-2 options, at least according to their respective documentations:
- grub-legacy (aka grub-0.9x):
http://www.gnu.org/software/grub/manual/legacy/grub.html#color
- grub-2:
http://www.gnu.org/software/grub/manual/grub.html#Theme-File-Manual

That's because the documentation is not up-to-date with the Debian patches additions. Those options are really handled, they really have an effect (I tested it). I learned about them while reading:

http://www.katspace.org/computers/Grub_Splash/

This option is added by the Debian specific patch debian/patches/graphics.diff. Here is the definition of the foreground option in Debian's patch:

+static struct builtin builtin_foreground =
+{

+  "foreground",
+  foreground_func,
+  BUILTIN_CMDLINE | BUILTIN_MENU | BUILTIN_HELP_LIST,
+  "foreground RRGGBB",
+  "Sets the foreground color when in graphics mode."
+  "RR is red, GG is green, and BB blue. Numbers must be in hexadecimal."

+};

Best regards,

Thomas

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

PATCH 8/9 fs/iso9660: add Grub splashscreen support

Thomas, All,

On 2013-12-29 11:24 +0100, Thomas Petazzoni spake thusly:

Quoted 22 lines · Yann E. MORIN
Quoted 12 lines
Quoted 12 lines
fs/iso9660/menu.lst +3 -1
index ed7836a..b1ba3c9 100644
@@ -1,6 +1,9 @@
 default		0
 timeout		10
-color cyan/blue white/blue
+color 		cyan/blue white/blue
+splashimage	/splash.xpm.gz
+foreground 	000000
Quoted 8 lines

fs/iso9660/menu.lst line 6

Quoted 1 line
fs/iso9660/menu.lst +1 -0
+background 	cccccc

'foreground' and 'background' do not seem to be valid grub-legacy or grub-2 options, at least according to their respective documentations:
- grub-legacy (aka grub-0.9x):
http://www.gnu.org/software/grub/manual/legacy/grub.html#color
- grub-2:
http://www.gnu.org/software/grub/manual/grub.html#Theme-File-Manual

Quoted 5 lines

That's because the documentation is not up-to-date with the Debian patches additions. Those options are really handled, they really have an effect (I tested it). I learned about them while reading:

http://www.katspace.org/computers/Grub_Splash/

Hey! Nice ressource! :-)

Maybe we could add a reference to it somewhere in our docs?

Quoted 2 lines

This option is added by the Debian specific patch
debian/patches/graphics.diff.

Ah right, because we're using a Debian snapshot, not an official release.

Review

Quoted 12 lines

Here is the definition of the foreground
option in Debian's patch:

(quoted diff) +9 -0
+static struct builtin builtin_foreground =
+{
+  "foreground",
+  foreground_func,
+  BUILTIN_CMDLINE | BUILTIN_MENU | BUILTIN_HELP_LIST,
+  "foreground RRGGBB",
+  "Sets the foreground color when in graphics mode."
+  "RR is red, GG is green, and BB blue. Numbers must be in hexadecimal."
+};

But then, to be clean, maybe we'd want to also get rid of 'foreground' and 'background' when there's no splashscreen. From the link you quoted:

The "foreground" and "background" commands seem to only take effect when a splash image is used; otherwise grub uses the "color" command.

Granted, this does not seem to be strictly required, but I think it'be better to just remove it, to avoid the user being puzzled that his changing foregroud/background has no effect...

Or at least a comment that basically says:
# {fore,back}ground have no effect without a splashscreen:
foreground 000000
background cccccc

Regards,
Yann E. MORIN.

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.  |
'------------------------------^-------^------------------^--------------------'
#21 lore raw

PATCH 8/9 fs/iso9660: add Grub splashscreen support

Dear Yann E. MORIN,

Quoted 9 lines · Yann E. MORIN
Quoted 5 lines

That's because the documentation is not up-to-date with the Debian patches additions. Those options are really handled, they really have an effect (I tested it). I learned about them while reading:

http://www.katspace.org/computers/Grub_Splash/

Hey! Nice ressource! :-)

Maybe we could add a reference to it somewhere in our docs?

True, I'll add it in the help text of the Splash image support.

Quoted 16 lines

Review

Quoted 9 lines
(quoted diff) +9 -0
+static struct builtin builtin_foreground =
+{
+  "foreground",
+  foreground_func,
+  BUILTIN_CMDLINE | BUILTIN_MENU | BUILTIN_HELP_LIST,
+  "foreground RRGGBB",
+  "Sets the foreground color when in graphics mode."
+  "RR is red, GG is green, and BB blue. Numbers must be in hexadecimal."
+};

But then, to be clean, maybe we'd want to also get rid of 'foreground' and 'background' when there's no splashscreen. From the link you quoted:

The "foreground" and "background" commands seem to only take effect when a splash image is used; otherwise grub uses the "color" command.

Quoted 8 lines

Granted, this does not seem to be strictly required, but I think it'be better to just remove it, to avoid the user being puzzled that his changing foregroud/background has no effect...

Or at least a comment that basically says:
# {fore,back}ground have no effect without a splashscreen:
foreground 000000
background cccccc

Well, since they have not effect when the splashimage is disabled, I wanted to avoid adding more code in iso9660.mk/grub.mk. But indeed, adding a comment might be useful.

I'll respin the series with your comments taken into account, thanks!

Thomas

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

PATCH 9/9 grub: align splashscreen handling with iso9660 code

In reply to Thomas Petazzoni

This commit aligns the Grub handling of the splash screen with what is done in the ISO9660 code.

---
 boot/grub/grub.mk  |  5 ++++-
 boot/grub/menu.lst | 11 +++++++----
 2 files changed, 11 insertions(+), 5 deletions(-)
boot/grub/grub.mk +4 -1
index 3be4a74..d22df88 100644
@@ -82,7 +82,10 @@ GRUB_CONF_OPT = \
 ifeq ($(BR2_TARGET_GRUB_SPLASH),y)
 define GRUB_INSTALL_SPLASH
 	cp boot/grub/splash.xpm.gz $(TARGET_DIR)/boot/grub/
-	$(SED) 's/^#splashimage/splashimage/' $(TARGET_DIR)/boot/grub/menu.lst
+endef
+else
+define GRUB_INSTALL_SPLASH
+	$(SED) '/^splashimage/d' $(TARGET_DIR)/boot/grub/menu.lst
 endef
 endif
 
boot/grub/menu.lst +7 -4
index 7845fee..09426f2 100644
@@ -1,7 +1,10 @@
-default=0
-timeout=5
-#splashimage=(hd0,0)/boot/grub/splash.xpm.gz
-hiddenmenu
+default		0
+timeout		10
+color 		cyan/blue white/blue
+splashimage	(hd0,0)/boot/grub/splash.xpm.gz
+foreground 	000000
+background 	cccccc
+
 title Buildroot
 	root (hd0,0)
 	kernel /boot/bzImage rw root=/dev/sda1
Signature · 1 line
1.8.3.2
#23 lore raw

PATCH 9/9 grub: align splashscreen handling with iso9660 code

Thomas, All,

On 2013-12-28 15:56 +0100, Thomas Petazzoni spake thusly:

Quoted 30 lines

This commit aligns the Grub handling of the splash screen with what is done in the ISO9660 code.

---
 boot/grub/grub.mk  |  5 ++++-
 boot/grub/menu.lst | 11 +++++++----
 2 files changed, 11 insertions(+), 5 deletions(-)
boot/grub/grub.mk +4 -1
index 3be4a74..d22df88 100644
@@ -82,7 +82,10 @@ GRUB_CONF_OPT = \
 ifeq ($(BR2_TARGET_GRUB_SPLASH),y)
 define GRUB_INSTALL_SPLASH
 	cp boot/grub/splash.xpm.gz $(TARGET_DIR)/boot/grub/
-	$(SED) 's/^#splashimage/splashimage/' $(TARGET_DIR)/boot/grub/menu.lst
+endef
+else
+define GRUB_INSTALL_SPLASH
+	$(SED) '/^splashimage/d' $(TARGET_DIR)/boot/grub/menu.lst
 endef
 endif
 
boot/grub/menu.lst +0 -0
index 7845fee..09426f2 100644

boot/grub/menu.lst line 6

Quoted 10 lines
boot/grub/menu.lst +6 -4
@@ -1,7 +1,10 @@
-default=0
-timeout=5
-#splashimage=(hd0,0)/boot/grub/splash.xpm.gz
-hiddenmenu
+default		0
+timeout		10
+color 		cyan/blue white/blue
+splashimage	(hd0,0)/boot/grub/splash.xpm.gz
+foreground 	000000
+background 	cccccc

Ditto, see my reply to the previous patch.

Regards,
Yann E. MORIN.

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.  |
'------------------------------^-------^------------------^--------------------'
#24 lore raw

PATCH 9/9 grub: align splashscreen handling with iso9660 code

Dear Yann E. MORIN,

Quoted 4 lines · Yann E. MORIN

boot/grub/menu.lst line 6

Quoted 2 lines
boot/grub/menu.lst +2 -0
+foreground 	000000
+background 	cccccc

Ditto, see my reply to the previous patch.

Same answer as patch 8/9 :-)

Thanks!

Thomas

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

cover iso9660/grub improvements

In reply to Thomas Petazzoni

Hello,

Quoted 11 lines · Thomas Petazzoni

Here is a set of commits that improves the iso9660/grub handling:

* Ensures that grub is built with the iso9660 support when the iso9660 image format has been selected.

* Add splashscreen support to Grub for the iso9660 image mechanism.

* Do not include the initrd into the filesystem if it is built into the kernel image itself.

* Related improvements/fixes

I have applied patches 1, 2, 3, 4 and 7. For patches 5, 6, 8 and 9, I'm waiting for Yann's Acked-by, or someone else Acked-by :)

Thanks!

Thomas

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

cover iso9660/grub improvements

Thomas, All,

On 2013-12-29 12:19 +0100, Thomas Petazzoni spake thusly:

Quoted 9 lines · Thomas Petazzoni
Quoted 8 lines

Here is a set of commits that improves the iso9660/grub handling:

* Ensures that grub is built with the iso9660 support when the iso9660 image format has been selected.

* Add splashscreen support to Grub for the iso9660 image mechanism.

Quoted 7 lines
Quoted 4 lines

* Do not include the initrd into the filesystem if it is built into the kernel image itself.

* Related improvements/fixes

I have applied patches 1, 2, 3, 4 and 7. For patches 5, 6, 8 and 9, I'm waiting for Yann's Acked-by, or someone else Acked-by :)

I guess you can also apply patch 6/9 as I reviewed it.

Regards,
Yann E. MORIN.

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