Skip to contentSkip to conversation

grub/iso9660 improvements

PATCH New Thomas Petazzoni 2 participants 9 messages Dec 29, 2013

lore
Share & tools
lore
#0 lore raw

v2 cover grub/iso9660 improvements

Hello,

Here is the v2 of the grub/iso9660 improvements. Changes since v1:

* Dropped patches that have been applied.

* Added comments in the menu.lst files that explains when color vs. foreground/background are used (Yann)

* Added link in the splashimage Config.in option help text that explains how to generate a splashimage (Yann).

Thanks!

Thomas

Thomas Petazzoni (4):
linux: enable initrd/initramfs support when cpio rootfs is chosen fs/iso9660: add Grub splashscreen support
grub: align splashscreen handling with iso9660 code
grub: add web reference that documents how to generate a splashimage

 boot/grub/Config.in   |  6 ++++--
 boot/grub/grub.mk     |  5 ++++-
 boot/grub/menu.lst    | 17 +++++++++++++----
 fs/iso9660/iso9660.mk |  5 +++++
 fs/iso9660/menu.lst   | 11 ++++++++++-
 linux/linux.mk        |  3 ++-
 6 files changed, 38 insertions(+), 9 deletions(-)
Signature · 1 line
1.8.3.2
#1 lore raw

PATCH v2 1/4 linux: enable initrd/initramfs support when cpio rootfs is chosen

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
#2 lore raw

PATCH v2 1/4 linux: enable initrd/initramfs support when cpio rootfs is chosen

Thomas, All,

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

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

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.

Quoted 6 lines

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.

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 v2 2/4 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   | 11 ++++++++++-
 2 files changed, 15 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 +10 -1
index ed7836a..c0bbff6 100644
@@ -1,6 +1,15 @@
 default		0
 timeout		10
-color cyan/blue white/blue
+
+# Used when no splashimage is used
+color 		cyan/blue white/blue
+
+# Gets enabled/disabled depending on Grub support for splashimage
+splashimage	/splash.xpm.gz
+
+# Used when a splashimage is enabled
+foreground 	000000
+background 	cccccc
 
 title		Buildroot ISO9660 image
 kernel		/kernel
Signature · 1 line
1.8.3.2
#4 lore raw

PATCH v2 2/4 fs/iso9660: add Grub splashscreen support

Thomas, All,

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

Quoted 15 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   | 11 ++++++++++-
 2 files changed, 15 insertions(+), 1 deletion(-)
fs/iso9660/iso9660.mk +0 -0
index 56e87bb..0260d41 100644

fs/iso9660/iso9660.mk $(BINARIES_DIR)/rootfs.iso9660: host-cdrkit host-fakeroot linux rootfs-cpio grub · line 20

Quoted 5 lines
fs/iso9660/iso9660.mk +2 -0
@@ -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

This would also get rid of the comments, but keep foreground/background untouched. Maybe:
/^splashimage/d

Quoted 17 lines
fs/iso9660/iso9660.mk +3 -0
+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 +3 -1
index ed7836a..c0bbff6 100644
@@ -1,6 +1,15 @@
 default		0
 timeout		10
-color cyan/blue white/blue
+
+# Used when no splashimage is used
+color 		cyan/blue white/blue

fs/iso9660/menu.lst line 15

Quoted 10 lines
fs/iso9660/menu.lst +7 -0
+
+# Gets enabled/disabled depending on Grub support for splashimage
+splashimage	/splash.xpm.gz
+
+# Used when a splashimage is enabled
+foreground 	000000
+background 	cccccc
 
 title		Buildroot ISO9660 image
 kernel		/kernel

With that fixed: Acked-by: "Yann E. MORIN" <[email protected]>

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 v2 3/4 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 | 17 +++++++++++++----
 2 files changed, 17 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 +13 -4
index 7845fee..a231f7e 100644
@@ -1,7 +1,16 @@
-default=0
-timeout=5
-#splashimage=(hd0,0)/boot/grub/splash.xpm.gz
-hiddenmenu
+default		0
+timeout		10
+
+# Used when no splashimage is used
+color 		cyan/blue white/blue
+
+# Gets enabled/disabled depending on Grub support for splashimage
+splashimage	(hd0,0)/boot/grub/splash.xpm.gz
+
+# Used when a splashimage is enabled
+foreground 	000000
+background 	cccccc
+
 title Buildroot
 	root (hd0,0)
 	kernel /boot/bzImage rw root=/dev/sda1
Signature · 1 line
1.8.3.2
#6 lore raw

PATCH v2 3/4 grub: align splashscreen handling with iso9660 code

Thomas, All,

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

Quoted 4 lines

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

But see below...

boot/grub/grub.mk GRUB_CONF_OPT = \ · line 88

Quoted 13 lines
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

Here you already use '/^splashimage/d' so it's not really at-par with the code in iso9660. ;-)

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 v2 4/4 grub: add web reference that documents how to generate a splashimage

In reply to Thomas Petazzoni
---
 boot/grub/Config.in | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
boot/grub/Config.in +4 -2
index 3ae8448..4db8642 100644
@@ -42,8 +42,10 @@ config BR2_TARGET_GRUB_SPLASH
 	help
 	  Add support for splashimage.
 
-	  A splashimage is a 14-color indexed .xpm picture which
-	  is displayed as background for the grub menu.
+	  A splashimage is a 14-color indexed .xpm picture which is
+	  displayed as background for the grub menu. See
+	  http://www.katspace.org/computers/Grub_Splash/ for details
+	  on how to generate a splashimage.
 
 config BR2_TARGET_GRUB_DISKLESS
 	bool "diskless support"
Signature · 1 line
1.8.3.2
#8 lore raw

PATCH v2 4/4 grub: add web reference that documents how to generate a splashimage

Thomas, All,

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

Quoted 1 line

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