Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCHv2 00/15] iso9660 support improvements
@ 2015-06-08 22:21 Thomas Petazzoni
  2015-06-08 22:21 ` [Buildroot] [PATCHv2 01/15] fs/iso9660: use if ... endif block instead of depends on Thomas Petazzoni
                   ` (14 more replies)
  0 siblings, 15 replies; 32+ messages in thread
From: Thomas Petazzoni @ 2015-06-08 22:21 UTC (permalink / raw)
  To: buildroot

Hello,

The following patch series brings a number of improvements to the
ISO9660 support. It takes into account some of the patches that have
been submitted on the topic, and that still sit in patchwork due to
the patches not being completely appropriate, and hopefully
re-implement the same features (and more) in a solution that is
acceptable in Buildroot.

The main features are:

 * Ability to put the root filesystem directly as the ISO9660
   filesystem, instead of having to use an initrd/initramfs to embed
   the root filesystem.

 * Support for using isolinux or Grub2 as alternate bootloaders to
   grub.

 * Support for generating hybrid ISO images (which can boot from
   either CD-ROM or USB keys), when isolinux is used.

Changes since v1:

 - Use $(BUILD_DIR)/rootfs-iso9660.tmp instead of $(BUILD_DIR)/iso9660
   as the temporary directory, as suggested by Yann.

 - Leave the temporary directory around after the build, as suggested
   by Arnout. This allows to remove the need for <fs>_POST_GEN_HOOKS.

 - Invert logic for the splash screen test in order to use positive
   logic. Suggested by Yann.

 - Put the simple "fs/iso9660: use if ... endif block instead of
   depends on" patch earlier in the series. Suggested by Yann.

 - Add Acked-by to the different patches when provided, and when the
   corresponding patches have not been changed in any significant way.

 - Fixed commit log for "fs/iso9660: change the location of the splash
   image", as noticed by Yann.

 - Add patch to install the Grub splash image from $(TARGET_DIR)
   instead of picking it up from the Buildroot sources (allows
   customization of the splash image using rootfs overlay or
   post-build script). Suggested by Yann.

 - Improve commit log of "fs/iso9660: prepare cleaner kernel/initrd
   path handling", as suggested by Yann.

 - In "fs/iso9660: support building a real iso9660 filesystem", fix
   comment (noticed by Samuel), and use positive logic (suggested by
   Yann).

 - Split the patch "fs/iso9660: add support for isolinux" into several
   smaller patches, as suggested by Yann.

 - Use partition type 0x96 when generating an hybrid ISO
   image. Suggested by Yann.

 - Use the syslinux images from BINARIES_DIR (for isolinux.bin) and
   HOST_DIR (for linuxld.c32). Suggested by Yann.

Best regards,

Thomas

Thomas Petazzoni (15):
  fs/iso9660: use if ... endif block instead of depends on
  fs/iso9660: convert to the filesystem infrastructure
  fs/iso9660: enable Joliet extension
  fs/iso9660: rename all variables to use the ROOTFS_ISO9660 prefix
  fs/iso9660: change the location of the splash image
  fs/iso9660: get grub splash from $(TARGET_DIR)
  fs/iso9660: prepare cleaner kernel/initrd path handling
  fs/iso9660: support building a real iso9660 filesystem
  fs/iso9660: introduce new variables
  fs/iso9660: introduce bootloader choice
  fs/iso9660: use 'depends on' instead of 'select' for bootloader
  fs/iso9660: add isolinux support
  fs/iso9660: add hybrid image support
  grub2: prepare and install El Torito image
  fs/iso9660: add support for grub2

 boot/grub2/grub2.mk     |   2 +
 fs/iso9660/Config.in    |  83 ++++++++++++++++++++--
 fs/iso9660/grub.cfg     |   7 ++
 fs/iso9660/iso9660.mk   | 180 +++++++++++++++++++++++++++++++++++++-----------
 fs/iso9660/isolinux.cfg |   5 ++
 fs/iso9660/menu.lst     |   6 +-
 6 files changed, 233 insertions(+), 50 deletions(-)
 create mode 100644 fs/iso9660/grub.cfg
 create mode 100644 fs/iso9660/isolinux.cfg

-- 
2.1.0

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

* [Buildroot] [PATCHv2 01/15] fs/iso9660: use if ... endif block instead of depends on
  2015-06-08 22:21 [Buildroot] [PATCHv2 00/15] iso9660 support improvements Thomas Petazzoni
@ 2015-06-08 22:21 ` Thomas Petazzoni
  2015-06-08 22:21 ` [Buildroot] [PATCHv2 02/15] fs/iso9660: convert to the filesystem infrastructure Thomas Petazzoni
                   ` (13 subsequent siblings)
  14 siblings, 0 replies; 32+ messages in thread
From: Thomas Petazzoni @ 2015-06-08 22:21 UTC (permalink / raw)
  To: buildroot

In preparation to the addition of numerous additional options to the
iso9660 filesystem logic, use a if ... endif block instead of a
depends on for the only option that currently exists.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Samuel Martin <s.martin49@gmail.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
 fs/iso9660/Config.in | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/fs/iso9660/Config.in b/fs/iso9660/Config.in
index 50b4377..9d00ab8 100644
--- a/fs/iso9660/Config.in
+++ b/fs/iso9660/Config.in
@@ -8,11 +8,14 @@ config BR2_TARGET_ROOTFS_ISO9660
 	help
 	  Build a bootable iso9660 image
 
+if BR2_TARGET_ROOTFS_ISO9660
+
 config BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU
 	string "Boot menu.lst file"
-	depends on BR2_TARGET_ROOTFS_ISO9660
 	default "fs/iso9660/menu.lst"
 
+endif
+
 comment "iso image needs a Linux kernel to be built"
 	depends on BR2_i386 || BR2_x86_64
 	depends on !BR2_LINUX_KERNEL
-- 
2.1.0

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

* [Buildroot] [PATCHv2 02/15] fs/iso9660: convert to the filesystem infrastructure
  2015-06-08 22:21 [Buildroot] [PATCHv2 00/15] iso9660 support improvements Thomas Petazzoni
  2015-06-08 22:21 ` [Buildroot] [PATCHv2 01/15] fs/iso9660: use if ... endif block instead of depends on Thomas Petazzoni
@ 2015-06-08 22:21 ` Thomas Petazzoni
  2015-06-14 14:52   ` Yann E. MORIN
  2015-06-08 22:21 ` [Buildroot] [PATCHv2 03/15] fs/iso9660: enable Joliet extension Thomas Petazzoni
                   ` (12 subsequent siblings)
  14 siblings, 1 reply; 32+ messages in thread
From: Thomas Petazzoni @ 2015-06-08 22:21 UTC (permalink / raw)
  To: buildroot

This commit converts the iso9660 logic to the common rootfs
infrastructure. What previously prevented it from being converted is
that the iso9660 logic needed to remove a temporary folder after the
image has been created.

However, since Buildroot typically keeps build artefacts around, this
commit changes the logic to keep this temporary folder around. Thanks
to this change, converting to the common rootfs infrastructure becomes
possible.

In addition, the temporary folder is renamed from $(BUILD_DIR)/iso9660
to the more descriptive $(BUILD_DIR)/rootfs-iso9660.tmp.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 fs/iso9660/iso9660.mk | 68 +++++++++++++++++++++++----------------------------
 1 file changed, 31 insertions(+), 37 deletions(-)

diff --git a/fs/iso9660/iso9660.mk b/fs/iso9660/iso9660.mk
index 4ccfce9..35b0fe5 100644
--- a/fs/iso9660/iso9660.mk
+++ b/fs/iso9660/iso9660.mk
@@ -2,59 +2,53 @@
 #
 # Build the iso96600 root filesystem image
 #
-# Cannot be converted to the ROOTFS_TARGET infrastructure, because of
-# the temporary construction in ISO9660_TARGET_DIR.
-#
 ################################################################################
 
-ISO9660_TARGET_DIR = $(BUILD_DIR)/iso9660
+ISO9660_TARGET_DIR = $(BUILD_DIR)/rootfs-iso9660.tmp
 ISO9660_BOOT_MENU := $(call qstrip,$(BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU))
 
 ROOTFS_ISO9660_DEPENDENCIES = grub host-cdrkit host-fakeroot linux rootfs-cpio
 
-$(BINARIES_DIR)/rootfs.iso9660: $(ROOTFS_ISO9660_DEPENDENCIES)
-	@$(call MESSAGE,"Generating root filesystem image rootfs.iso9660")
-	$(INSTALL) -D -m 0644 $(GRUB_DIR)/stage2/stage2_eltorito \
-		$(ISO9660_TARGET_DIR)/boot/grub/stage2_eltorito
-	$(INSTALL) -D -m 0644 $(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
+ifeq ($(BR2_TARGET_GRUB_SPLASH),y)
+define ROOTFS_ISO9660_SPLASHSCREEN
 	$(INSTALL) -D -m 0644 boot/grub/splash.xpm.gz \
 		$(ISO9660_TARGET_DIR)/splash.xpm.gz
+endef
+else
+define ROOTFS_ISO9660_SPLASHSCREEN
+	$(SED) '/^splashimage/d' $(ISO9660_TARGET_DIR)/boot/grub/menu.lst
+endef
 endif
-	$(INSTALL) -D -m 0644 $(LINUX_IMAGE_PATH) $(ISO9660_TARGET_DIR)/kernel
+
 ifeq ($(BR2_TARGET_ROOTFS_INITRAMFS),y)
+define ROOTFS_ISO9660_INITRD
 	$(SED) '/initrd/d'  $(ISO9660_TARGET_DIR)/boot/grub/menu.lst
+endef
 else
+define ROOTFS_ISO9660_INITRD
 	$(INSTALL) -D -m 0644 $(BINARIES_DIR)/rootfs.cpio$(ROOTFS_CPIO_COMPRESS_EXT) \
 		$(ISO9660_TARGET_DIR)/initrd
+endef
 endif
-	# Use fakeroot to pretend all target binaries are owned by root
-	rm -f $(FAKEROOT_SCRIPT)
-	echo "chown -h -R 0:0 $(ISO9660_TARGET_DIR)" >> $(FAKEROOT_SCRIPT)
-	# Use fakeroot so mkisofs believes the previous fakery
-	echo "$(HOST_DIR)/usr/bin/genisoimage -R -b boot/grub/stage2_eltorito -no-emul-boot " \
-		"-boot-load-size 4 -boot-info-table -o $@ $(ISO9660_TARGET_DIR)" \
-		>> $(FAKEROOT_SCRIPT)
-	chmod a+x $(FAKEROOT_SCRIPT)
-	$(HOST_DIR)/usr/bin/fakeroot -- $(FAKEROOT_SCRIPT)
-	- at rm -f $(FAKEROOT_SCRIPT)
-	- at rm -rf $(ISO9660_TARGET_DIR)
 
-rootfs-iso9660: $(BINARIES_DIR)/rootfs.iso9660
+define ROOTFS_ISO9660_PREPARATION
+	$(RM) -rf $(ISO9660_TARGET_DIR)
+	mkdir -p $(ISO9660_TARGET_DIR)
+	$(INSTALL) -D -m 0644 $(GRUB_DIR)/stage2/stage2_eltorito \
+		$(ISO9660_TARGET_DIR)/boot/grub/stage2_eltorito
+	$(INSTALL) -D -m 0644 $(ISO9660_BOOT_MENU) \
+		$(ISO9660_TARGET_DIR)/boot/grub/menu.lst
+	$(INSTALL) -D -m 0644 $(LINUX_IMAGE_PATH) $(ISO9660_TARGET_DIR)/kernel
+	$(ROOTFS_ISO9660_SPLASHSCREEN)
+	$(ROOTFS_ISO9660_INITRD)
+endef
 
-rootfs-iso9660-show-depends:
-	@echo $(ROOTFS_ISO9660_DEPENDENCIES)
+ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_PREPARATION
 
-.PHONY: rootfs-iso9660 rootfs-iso9660-show-depends
+define ROOTFS_ISO9660_CMD
+	$(HOST_DIR)/usr/bin/genisoimage -R -b boot/grub/stage2_eltorito \
+		-no-emul-boot -boot-load-size 4 -boot-info-table \
+		-o $@ $(ISO9660_TARGET_DIR)
+endef
 
-################################################################################
-#
-# Toplevel Makefile options
-#
-################################################################################
-ifeq ($(BR2_TARGET_ROOTFS_ISO9660),y)
-TARGETS_ROOTFS += rootfs-iso9660
-endif
+$(eval $(call ROOTFS_TARGET,iso9660))
-- 
2.1.0

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

* [Buildroot] [PATCHv2 03/15] fs/iso9660: enable Joliet extension
  2015-06-08 22:21 [Buildroot] [PATCHv2 00/15] iso9660 support improvements Thomas Petazzoni
  2015-06-08 22:21 ` [Buildroot] [PATCHv2 01/15] fs/iso9660: use if ... endif block instead of depends on Thomas Petazzoni
  2015-06-08 22:21 ` [Buildroot] [PATCHv2 02/15] fs/iso9660: convert to the filesystem infrastructure Thomas Petazzoni
@ 2015-06-08 22:21 ` Thomas Petazzoni
  2015-06-08 22:21 ` [Buildroot] [PATCHv2 04/15] fs/iso9660: rename all variables to use the ROOTFS_ISO9660 prefix Thomas Petazzoni
                   ` (11 subsequent siblings)
  14 siblings, 0 replies; 32+ messages in thread
From: Thomas Petazzoni @ 2015-06-08 22:21 UTC (permalink / raw)
  To: buildroot

We already enable the Rockridge extension by default when building
ISO9660, so let's also enable the Joliet extension which allows to
support Unicode file names and long file names.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Samuel Martin <s.martin49@gmail.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
 fs/iso9660/iso9660.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/iso9660/iso9660.mk b/fs/iso9660/iso9660.mk
index 35b0fe5..b2f00fd 100644
--- a/fs/iso9660/iso9660.mk
+++ b/fs/iso9660/iso9660.mk
@@ -46,7 +46,7 @@ endef
 ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_PREPARATION
 
 define ROOTFS_ISO9660_CMD
-	$(HOST_DIR)/usr/bin/genisoimage -R -b boot/grub/stage2_eltorito \
+	$(HOST_DIR)/usr/bin/genisoimage -J -R -b boot/grub/stage2_eltorito \
 		-no-emul-boot -boot-load-size 4 -boot-info-table \
 		-o $@ $(ISO9660_TARGET_DIR)
 endef
-- 
2.1.0

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

* [Buildroot] [PATCHv2 04/15] fs/iso9660: rename all variables to use the ROOTFS_ISO9660 prefix
  2015-06-08 22:21 [Buildroot] [PATCHv2 00/15] iso9660 support improvements Thomas Petazzoni
                   ` (2 preceding siblings ...)
  2015-06-08 22:21 ` [Buildroot] [PATCHv2 03/15] fs/iso9660: enable Joliet extension Thomas Petazzoni
@ 2015-06-08 22:21 ` Thomas Petazzoni
  2015-06-08 22:21 ` [Buildroot] [PATCHv2 05/15] fs/iso9660: change the location of the splash image Thomas Petazzoni
                   ` (10 subsequent siblings)
  14 siblings, 0 replies; 32+ messages in thread
From: Thomas Petazzoni @ 2015-06-08 22:21 UTC (permalink / raw)
  To: buildroot

For consistency reasons, this commit renames all internal variables of
iso9660.mk to use the ROOTFS_ISO9660 prefix.

While we're at it, replace a useless ':=' by '='.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Samuel Martin <s.martin49@gmail.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
 fs/iso9660/iso9660.mk | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/fs/iso9660/iso9660.mk b/fs/iso9660/iso9660.mk
index b2f00fd..54b1653 100644
--- a/fs/iso9660/iso9660.mk
+++ b/fs/iso9660/iso9660.mk
@@ -4,41 +4,41 @@
 #
 ################################################################################
 
-ISO9660_TARGET_DIR = $(BUILD_DIR)/rootfs-iso9660.tmp
-ISO9660_BOOT_MENU := $(call qstrip,$(BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU))
+ROOTFS_ISO9660_TARGET_DIR = $(BUILD_DIR)/rootfs-iso9660.tmp
+ROOTFS_ISO9660_BOOT_MENU = $(call qstrip,$(BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU))
 
 ROOTFS_ISO9660_DEPENDENCIES = grub host-cdrkit host-fakeroot linux rootfs-cpio
 
 ifeq ($(BR2_TARGET_GRUB_SPLASH),y)
 define ROOTFS_ISO9660_SPLASHSCREEN
 	$(INSTALL) -D -m 0644 boot/grub/splash.xpm.gz \
-		$(ISO9660_TARGET_DIR)/splash.xpm.gz
+		$(ROOTFS_ISO9660_TARGET_DIR)/splash.xpm.gz
 endef
 else
 define ROOTFS_ISO9660_SPLASHSCREEN
-	$(SED) '/^splashimage/d' $(ISO9660_TARGET_DIR)/boot/grub/menu.lst
+	$(SED) '/^splashimage/d' $(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/menu.lst
 endef
 endif
 
 ifeq ($(BR2_TARGET_ROOTFS_INITRAMFS),y)
 define ROOTFS_ISO9660_INITRD
-	$(SED) '/initrd/d'  $(ISO9660_TARGET_DIR)/boot/grub/menu.lst
+	$(SED) '/initrd/d'  $(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/menu.lst
 endef
 else
 define ROOTFS_ISO9660_INITRD
 	$(INSTALL) -D -m 0644 $(BINARIES_DIR)/rootfs.cpio$(ROOTFS_CPIO_COMPRESS_EXT) \
-		$(ISO9660_TARGET_DIR)/initrd
+		$(ROOTFS_ISO9660_TARGET_DIR)/initrd
 endef
 endif
 
 define ROOTFS_ISO9660_PREPARATION
-	$(RM) -rf $(ISO9660_TARGET_DIR)
-	mkdir -p $(ISO9660_TARGET_DIR)
+	$(RM) -rf $(ROOTFS_ISO9660_TARGET_DIR)
+	mkdir -p $(ROOTFS_ISO9660_TARGET_DIR)
 	$(INSTALL) -D -m 0644 $(GRUB_DIR)/stage2/stage2_eltorito \
-		$(ISO9660_TARGET_DIR)/boot/grub/stage2_eltorito
-	$(INSTALL) -D -m 0644 $(ISO9660_BOOT_MENU) \
-		$(ISO9660_TARGET_DIR)/boot/grub/menu.lst
-	$(INSTALL) -D -m 0644 $(LINUX_IMAGE_PATH) $(ISO9660_TARGET_DIR)/kernel
+		$(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/stage2_eltorito
+	$(INSTALL) -D -m 0644 $(ROOTFS_ISO9660_BOOT_MENU) \
+		$(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/menu.lst
+	$(INSTALL) -D -m 0644 $(LINUX_IMAGE_PATH) $(ROOTFS_ISO9660_TARGET_DIR)/kernel
 	$(ROOTFS_ISO9660_SPLASHSCREEN)
 	$(ROOTFS_ISO9660_INITRD)
 endef
@@ -48,7 +48,7 @@ ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_PREPARATION
 define ROOTFS_ISO9660_CMD
 	$(HOST_DIR)/usr/bin/genisoimage -J -R -b boot/grub/stage2_eltorito \
 		-no-emul-boot -boot-load-size 4 -boot-info-table \
-		-o $@ $(ISO9660_TARGET_DIR)
+		-o $@ $(ROOTFS_ISO9660_TARGET_DIR)
 endef
 
 $(eval $(call ROOTFS_TARGET,iso9660))
-- 
2.1.0

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

* [Buildroot] [PATCHv2 05/15] fs/iso9660: change the location of the splash image
  2015-06-08 22:21 [Buildroot] [PATCHv2 00/15] iso9660 support improvements Thomas Petazzoni
                   ` (3 preceding siblings ...)
  2015-06-08 22:21 ` [Buildroot] [PATCHv2 04/15] fs/iso9660: rename all variables to use the ROOTFS_ISO9660 prefix Thomas Petazzoni
@ 2015-06-08 22:21 ` Thomas Petazzoni
  2015-06-08 22:21 ` [Buildroot] [PATCHv2 06/15] fs/iso9660: get grub splash from $(TARGET_DIR) Thomas Petazzoni
                   ` (9 subsequent siblings)
  14 siblings, 0 replies; 32+ messages in thread
From: Thomas Petazzoni @ 2015-06-08 22:21 UTC (permalink / raw)
  To: buildroot

In order to simplify the introduction of the support for using ISO9660
as the real root filesystem, this commit changes the location of the
grub splash image. This makes it match where the splash image is
located in $(TARGET_DIR), so that regardless of whether the
initrd/initramfs solution or the real iso9660 filesystem solution are
used, the splash image is installed at the same location.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Samuel Martin <s.martin49@gmail.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
 fs/iso9660/iso9660.mk | 2 +-
 fs/iso9660/menu.lst   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/iso9660/iso9660.mk b/fs/iso9660/iso9660.mk
index 54b1653..b3e6b9d 100644
--- a/fs/iso9660/iso9660.mk
+++ b/fs/iso9660/iso9660.mk
@@ -12,7 +12,7 @@ ROOTFS_ISO9660_DEPENDENCIES = grub host-cdrkit host-fakeroot linux rootfs-cpio
 ifeq ($(BR2_TARGET_GRUB_SPLASH),y)
 define ROOTFS_ISO9660_SPLASHSCREEN
 	$(INSTALL) -D -m 0644 boot/grub/splash.xpm.gz \
-		$(ROOTFS_ISO9660_TARGET_DIR)/splash.xpm.gz
+		$(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/splash.xpm.gz
 endef
 else
 define ROOTFS_ISO9660_SPLASHSCREEN
diff --git a/fs/iso9660/menu.lst b/fs/iso9660/menu.lst
index c0bbff6..fd5c76a 100644
--- a/fs/iso9660/menu.lst
+++ b/fs/iso9660/menu.lst
@@ -5,7 +5,7 @@ timeout		10
 color 		cyan/blue white/blue
 
 # Gets enabled/disabled depending on Grub support for splashimage
-splashimage	/splash.xpm.gz
+splashimage	/boot/grub/splash.xpm.gz
 
 # Used when a splashimage is enabled
 foreground 	000000
-- 
2.1.0

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

* [Buildroot] [PATCHv2 06/15] fs/iso9660: get grub splash from $(TARGET_DIR)
  2015-06-08 22:21 [Buildroot] [PATCHv2 00/15] iso9660 support improvements Thomas Petazzoni
                   ` (4 preceding siblings ...)
  2015-06-08 22:21 ` [Buildroot] [PATCHv2 05/15] fs/iso9660: change the location of the splash image Thomas Petazzoni
@ 2015-06-08 22:21 ` Thomas Petazzoni
  2015-06-14 14:59   ` Yann E. MORIN
  2015-06-08 22:21 ` [Buildroot] [PATCHv2 07/15] fs/iso9660: prepare cleaner kernel/initrd path handling Thomas Petazzoni
                   ` (8 subsequent siblings)
  14 siblings, 1 reply; 32+ messages in thread
From: Thomas Petazzoni @ 2015-06-08 22:21 UTC (permalink / raw)
  To: buildroot

Instead of using directly the splash image from the Buildroot source
directory boot/grub, this commit changes the iso9660 logic to use the
splash image installed in $(TARGET_DIR)/boot/grub.

This effectively allows a user to use a custom splash image by
installing it to $(TARGET_DIR) through a rootfs overlay or using a
post-build script.

Suggested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 fs/iso9660/iso9660.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/iso9660/iso9660.mk b/fs/iso9660/iso9660.mk
index b3e6b9d..b313c65 100644
--- a/fs/iso9660/iso9660.mk
+++ b/fs/iso9660/iso9660.mk
@@ -11,7 +11,7 @@ ROOTFS_ISO9660_DEPENDENCIES = grub host-cdrkit host-fakeroot linux rootfs-cpio
 
 ifeq ($(BR2_TARGET_GRUB_SPLASH),y)
 define ROOTFS_ISO9660_SPLASHSCREEN
-	$(INSTALL) -D -m 0644 boot/grub/splash.xpm.gz \
+	$(INSTALL) -D -m 0644 $(TARGET_DIR)/boot/grub/splash.xpm.gz \
 		$(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/splash.xpm.gz
 endef
 else
-- 
2.1.0

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

* [Buildroot] [PATCHv2 07/15] fs/iso9660: prepare cleaner kernel/initrd path handling
  2015-06-08 22:21 [Buildroot] [PATCHv2 00/15] iso9660 support improvements Thomas Petazzoni
                   ` (5 preceding siblings ...)
  2015-06-08 22:21 ` [Buildroot] [PATCHv2 06/15] fs/iso9660: get grub splash from $(TARGET_DIR) Thomas Petazzoni
@ 2015-06-08 22:21 ` Thomas Petazzoni
  2015-06-08 22:21 ` [Buildroot] [PATCHv2 08/15] fs/iso9660: support building a real iso9660 filesystem Thomas Petazzoni
                   ` (7 subsequent siblings)
  14 siblings, 0 replies; 32+ messages in thread
From: Thomas Petazzoni @ 2015-06-08 22:21 UTC (permalink / raw)
  To: buildroot

The iso9660.mk modifies the menu.lst file from Grub to set the correct
initrd/kernel image locations. However, with the upcoming support of
other bootloaders for iso9660 filesystems, we need to modify a bit
this logic.

Instead of relying on the specific details of the grub menu.lst
syntax, we introduce the __KERNEL_PATH__ and __INITRD_PATH__ magic
keywords, which iso9660.mk will replace by the appropriate
values. They can therefore be used where needed in grub menu.lst, and
in similar configuration files of other bootloaders, as will be
supported in the following commits.

Also, in order to be consistent with the soon to be introduced support
for having the root filesystem itself as iso9660, this commit changes
the installation location of the initrd and kernel. Instead of being
/initrd and /kernel, they become /boot/initrd and
/boot/$(LINUX_IMAGE_NAME).

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Samuel Martin <s.martin49@gmail.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
 fs/iso9660/Config.in  |  5 +++++
 fs/iso9660/iso9660.mk | 11 ++++++++---
 fs/iso9660/menu.lst   |  4 ++--
 3 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/fs/iso9660/Config.in b/fs/iso9660/Config.in
index 9d00ab8..111158b 100644
--- a/fs/iso9660/Config.in
+++ b/fs/iso9660/Config.in
@@ -13,6 +13,11 @@ if BR2_TARGET_ROOTFS_ISO9660
 config BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU
 	string "Boot menu.lst file"
 	default "fs/iso9660/menu.lst"
+	help
+	  Use this option to provide a custom Grub menu.lst file. Note
+	  that the strings __KERNEL_PATH__ and __INITRD_PATH__ will
+	  automatically be replaced by the path to the kernel and
+	  initrd images respectively.
 
 endif
 
diff --git a/fs/iso9660/iso9660.mk b/fs/iso9660/iso9660.mk
index b313c65..035561d 100644
--- a/fs/iso9660/iso9660.mk
+++ b/fs/iso9660/iso9660.mk
@@ -22,12 +22,14 @@ endif
 
 ifeq ($(BR2_TARGET_ROOTFS_INITRAMFS),y)
 define ROOTFS_ISO9660_INITRD
-	$(SED) '/initrd/d'  $(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/menu.lst
+	$(SED) '/__INITRD_PATH__/d'  $(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/menu.lst
 endef
 else
 define ROOTFS_ISO9660_INITRD
 	$(INSTALL) -D -m 0644 $(BINARIES_DIR)/rootfs.cpio$(ROOTFS_CPIO_COMPRESS_EXT) \
-		$(ROOTFS_ISO9660_TARGET_DIR)/initrd
+		$(ROOTFS_ISO9660_TARGET_DIR)/boot/initrd
+	$(SED) "s%__INITRD_PATH__%/boot/initrd%" \
+		$(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/menu.lst
 endef
 endif
 
@@ -38,7 +40,10 @@ define ROOTFS_ISO9660_PREPARATION
 		$(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/stage2_eltorito
 	$(INSTALL) -D -m 0644 $(ROOTFS_ISO9660_BOOT_MENU) \
 		$(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/menu.lst
-	$(INSTALL) -D -m 0644 $(LINUX_IMAGE_PATH) $(ROOTFS_ISO9660_TARGET_DIR)/kernel
+	$(INSTALL) -D -m 0644 $(LINUX_IMAGE_PATH) \
+		$(ROOTFS_ISO9660_TARGET_DIR)/boot/$(LINUX_IMAGE_NAME)
+	$(SED) "s%__KERNEL_PATH__%/boot/$(LINUX_IMAGE_NAME)%" \
+		$(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/menu.lst
 	$(ROOTFS_ISO9660_SPLASHSCREEN)
 	$(ROOTFS_ISO9660_INITRD)
 endef
diff --git a/fs/iso9660/menu.lst b/fs/iso9660/menu.lst
index fd5c76a..8e8309f 100644
--- a/fs/iso9660/menu.lst
+++ b/fs/iso9660/menu.lst
@@ -12,8 +12,8 @@ foreground 	000000
 background 	cccccc
 
 title		Buildroot ISO9660 image
-kernel		/kernel
-initrd		/initrd
+kernel		__KERNEL_PATH__
+initrd		__INITRD_PATH__
 
 title		Hard Drive (first partition)
 rootnoverify	(hd0)
-- 
2.1.0

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

* [Buildroot] [PATCHv2 08/15] fs/iso9660: support building a real iso9660 filesystem
  2015-06-08 22:21 [Buildroot] [PATCHv2 00/15] iso9660 support improvements Thomas Petazzoni
                   ` (6 preceding siblings ...)
  2015-06-08 22:21 ` [Buildroot] [PATCHv2 07/15] fs/iso9660: prepare cleaner kernel/initrd path handling Thomas Petazzoni
@ 2015-06-08 22:21 ` Thomas Petazzoni
  2015-06-14 15:17   ` Yann E. MORIN
  2015-06-08 22:21 ` [Buildroot] [PATCHv2 09/15] fs/iso9660: introduce new variables Thomas Petazzoni
                   ` (6 subsequent siblings)
  14 siblings, 1 reply; 32+ messages in thread
From: Thomas Petazzoni @ 2015-06-08 22:21 UTC (permalink / raw)
  To: buildroot

Until now, the iso9660 filesystem handling only supported using an
initrd/initramfs to store the root filesystem, which is very different
from what we do with the other filesystems.

This commit changes the iso9660 logic to also allow using directly an
iso9660 filesystem to store the root filesystem. A new option,
BR2_TARGET_ROOTFS_ISO9660_INITRD, is created to tell the iso9660 that
we want to use an initrd and not directly the root filesystem in
iso9660 format. This option defaults to 'y' to preserve the existing
behavior.

After this commit, we therefore have three possibilities:

 * BR2_TARGET_ROOTFS_ISO9660=y, with BR2_TARGET_ROOTFS_INITRAMFS and
   BR2_TARGET_ROOTFS_ISO9660_INITRD disabled. In this case, the
   iso9660 filesystem is directly the contents of the root filesystem
   (since is possible thanks to the Rockridge extensions that were
   already enabled using the -R option of genisoimage). Obviously, it
   means that the root filesystem is read-only.

 * BR2_TARGET_ROOTFS_ISO9660=y and BR2_TARGET_ROOTFS_INITRAMFS=y (the
   value of BR2_TARGET_ROOTFS_ISO9660_INITRD doesn't matter). In this
   case, the root filesystem is already linked into the kernel image
   itself, as an initramfs. So the iso9660 filesystem doesn't contain
   the root filesystem as is, but just the bootloader and the kernel
   image.

 * BR2_TARGET_ROOTFS_ISO9660=y, BR2_TARGET_ROOTFS_ISO9660_INITRD=y and
   BR2_TARGET_ROOTFS_INITRAMFS disabled. In this case, a separate
   initrd is used. The iso9660 filesystem only contains the
   bootloader, the kernel and the initrd.

In order to support the first case out of the box, root=/dev/sr0 is
added on the kernel command line in the example Grub configuration
file, so that the kernel knows where the root filesystem is
located. This argument is ignored when initrd/initramfs are used.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 fs/iso9660/Config.in  |  27 ++++++++++++-
 fs/iso9660/iso9660.mk | 109 ++++++++++++++++++++++++++++++++++++++------------
 fs/iso9660/menu.lst   |   2 +-
 3 files changed, 110 insertions(+), 28 deletions(-)

diff --git a/fs/iso9660/Config.in b/fs/iso9660/Config.in
index 111158b..e300fdb 100644
--- a/fs/iso9660/Config.in
+++ b/fs/iso9660/Config.in
@@ -2,11 +2,23 @@ config BR2_TARGET_ROOTFS_ISO9660
 	bool "iso image"
 	depends on (BR2_i386 || BR2_x86_64)
 	depends on BR2_LINUX_KERNEL
-	select BR2_TARGET_ROOTFS_CPIO
+	select BR2_LINUX_KERNEL_INSTALL_TARGET \
+	       if (!BR2_TARGET_ROOTFS_ISO9660_INITRD && !BR2_TARGET_ROOTFS_INITRAMFS)
 	select BR2_TARGET_GRUB
 	select BR2_TARGET_GRUB_FS_ISO9660
 	help
-	  Build a bootable iso9660 image
+	  Build a bootable ISO9660 image. By default, the root
+	  filesystem is directly packed as the ISO9660 filesystem,
+	  which means the root filesystem will be read-only. It
+	  requires ISO9660 filesystem support and CDROM support in the
+	  kernel.
+
+	  However, if BR2_TARGET_ROOTFS_INITRAMFS or
+	  BR2_TARGET_ROOTFS_ISO9660_INITRD have been enabled, the
+	  ISO9660 filesystem will only contain a kernel image and
+	  optionally an external initrd image. In this case, the
+	  filesystem being in RAM, it will be read/write. No ISO9660
+	  or CDROM support is needed in the kernel.
 
 if BR2_TARGET_ROOTFS_ISO9660
 
@@ -19,6 +31,17 @@ config BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU
 	  automatically be replaced by the path to the kernel and
 	  initrd images respectively.
 
+config BR2_TARGET_ROOTFS_ISO9660_INITRD
+	bool "Use initrd"
+	default y
+	select BR2_TARGET_ROOTFS_CPIO
+	help
+	  Enable this option to have the root filesystem bundled as an
+	  initrd/initramfs rather than directly as the ISO9660
+	  filesystem. With this option enabled, the ISO9660 will only
+	  contain a kernel image, an initrd image (unless an initramfs
+	  linked into the kernel is used) and the bootloader.
+
 endif
 
 comment "iso image needs a Linux kernel to be built"
diff --git a/fs/iso9660/iso9660.mk b/fs/iso9660/iso9660.mk
index 035561d..723fe94 100644
--- a/fs/iso9660/iso9660.mk
+++ b/fs/iso9660/iso9660.mk
@@ -4,51 +4,110 @@
 #
 ################################################################################
 
-ROOTFS_ISO9660_TARGET_DIR = $(BUILD_DIR)/rootfs-iso9660.tmp
+#
+# We need to handle three cases:
+#
+#  1. The ISO9660 filesystem will really be the real root filesystem
+#     itself. This is when BR2_TARGET_ROOTFS_ISO9660_INITRD is
+#     disabled.
+#
+#  2. The ISO9660 filesystem will be a filesystem with just a kernel
+#     image, initrd and grub. This is when
+#     BR2_TARGET_ROOTFS_ISO9660_INITRD is enabled, but
+#     BR2_TARGET_ROOTFS_INITRAMFS is disabled.
+#
+#  3. The ISO9660 filesystem will be a filesystem with just a kernel
+#     image and grub. This is like (2), except that the initrd is
+#     built into the kernel image. This is when
+#     BR2_TARGET_ROOTFS_INITRAMFS is enabled (regardless of the value
+#     of BR2_TARGET_ROOTFS_ISO9660_INITRD).
+
 ROOTFS_ISO9660_BOOT_MENU = $(call qstrip,$(BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU))
 
-ROOTFS_ISO9660_DEPENDENCIES = grub host-cdrkit host-fakeroot linux rootfs-cpio
+ROOTFS_ISO9660_DEPENDENCIES = grub host-cdrkit host-fakeroot linux
 
-ifeq ($(BR2_TARGET_GRUB_SPLASH),y)
-define ROOTFS_ISO9660_SPLASHSCREEN
-	$(INSTALL) -D -m 0644 $(TARGET_DIR)/boot/grub/splash.xpm.gz \
-		$(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/splash.xpm.gz
+ifeq ($(BR2_TARGET_ROOTFS_INITRAMFS),y)
+ROOTFS_ISO9660_USE_INITRD = YES
+endif
+
+ifeq ($(BR2_TARGET_ROOTFS_ISO9660_INITRD),y)
+ROOTFS_ISO9660_USE_INITRD = YES
+endif
+
+ifeq ($(ROOTFS_ISO9660_USE_INITRD),YES)
+ROOTFS_ISO9660_TARGET_DIR = $(BUILD_DIR)/rootfs-iso9660.tmp
+define ROOTFS_ISO9660_CREATE_TEMPDIR
+	$(RM) -rf $(ROOTFS_ISO9660_TARGET_DIR)
+	mkdir -p $(ROOTFS_ISO9660_TARGET_DIR)
 endef
 else
-define ROOTFS_ISO9660_SPLASHSCREEN
+ROOTFS_ISO9660_TARGET_DIR = $(TARGET_DIR)
+endif
+
+define ROOTFS_ISO9660_PREPARATION
+	$(INSTALL) -D -m 0644 $(GRUB_DIR)/stage2/stage2_eltorito \
+		$(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/stage2_eltorito
+	$(INSTALL) -D -m 0644 $(ROOTFS_ISO9660_BOOT_MENU) \
+		$(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/menu.lst
+	$(SED) "s%__KERNEL_PATH__%/boot/$(LINUX_IMAGE_NAME)%" \
+		$(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/menu.lst
+endef
+
+ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_PREPARATION
+
+# Splash screen disabling
+ifeq ($(BR2_TARGET_GRUB_SPLASH),)
+define ROOTFS_ISO9660_DISABLE_SPLASHSCREEN
 	$(SED) '/^splashimage/d' $(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/menu.lst
 endef
+ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_DISABLE_SPLASHSCREEN
 endif
 
-ifeq ($(BR2_TARGET_ROOTFS_INITRAMFS),y)
-define ROOTFS_ISO9660_INITRD
+define ROOTFS_ISO9660_DISABLE_EXTERNAL_INITRD
 	$(SED) '/__INITRD_PATH__/d'  $(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/menu.lst
 endef
+
+ifeq ($(ROOTFS_ISO9660_USE_INITRD),YES)
+
+# Copy splashscreen to temporary filesystem
+ifeq ($(BR2_TARGET_GRUB_SPLASH),y)
+define ROOTFS_ISO9660_INSTALL_SPLASHSCREEN
+	$(INSTALL) -D -m 0644 $(TARGET_DIR)/boot/grub/splash.xpm.gz \
+		$(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/splash.xpm.gz
+endef
+ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_INSTALL_SPLASHSCREEN
+endif
+
+# Copy the kernel to temporary filesystem
+define ROOTFS_ISO9660_COPY_KERNEL
+	$(INSTALL) -D -m 0644 $(LINUX_IMAGE_PATH) \
+		$(ROOTFS_ISO9660_TARGET_DIR)/boot/$(LINUX_IMAGE_NAME)
+endef
+
+ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_COPY_KERNEL
+
+# If initramfs is used, disable loading the initrd as the rootfs is
+# already inside the kernel image. Otherwise, make sure a cpio is
+# generated and use it as the initrd.
+ifeq ($(BR2_TARGET_ROOTFS_INITRAMFS),y)
+ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_DISABLE_EXTERNAL_INITRD
 else
-define ROOTFS_ISO9660_INITRD
+ROOTFS_ISO9660_DEPENDENCIES += rootfs-cpio
+define ROOTFS_ISO9660_COPY_INITRD
 	$(INSTALL) -D -m 0644 $(BINARIES_DIR)/rootfs.cpio$(ROOTFS_CPIO_COMPRESS_EXT) \
 		$(ROOTFS_ISO9660_TARGET_DIR)/boot/initrd
 	$(SED) "s%__INITRD_PATH__%/boot/initrd%" \
 		$(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/menu.lst
 endef
+ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_COPY_INITRD
 endif
 
-define ROOTFS_ISO9660_PREPARATION
-	$(RM) -rf $(ROOTFS_ISO9660_TARGET_DIR)
-	mkdir -p $(ROOTFS_ISO9660_TARGET_DIR)
-	$(INSTALL) -D -m 0644 $(GRUB_DIR)/stage2/stage2_eltorito \
-		$(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/stage2_eltorito
-	$(INSTALL) -D -m 0644 $(ROOTFS_ISO9660_BOOT_MENU) \
-		$(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/menu.lst
-	$(INSTALL) -D -m 0644 $(LINUX_IMAGE_PATH) \
-		$(ROOTFS_ISO9660_TARGET_DIR)/boot/$(LINUX_IMAGE_NAME)
-	$(SED) "s%__KERNEL_PATH__%/boot/$(LINUX_IMAGE_NAME)%" \
-		$(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/menu.lst
-	$(ROOTFS_ISO9660_SPLASHSCREEN)
-	$(ROOTFS_ISO9660_INITRD)
-endef
+else # ROOTFS_ISO9660_USE_INITRD
+
+ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_DISABLE_EXTERNAL_INITRD
+
+endif # ROOTFS_ISO9660_USE_INITRD
 
-ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_PREPARATION
 
 define ROOTFS_ISO9660_CMD
 	$(HOST_DIR)/usr/bin/genisoimage -J -R -b boot/grub/stage2_eltorito \
diff --git a/fs/iso9660/menu.lst b/fs/iso9660/menu.lst
index 8e8309f..eb1ecef 100644
--- a/fs/iso9660/menu.lst
+++ b/fs/iso9660/menu.lst
@@ -12,7 +12,7 @@ foreground 	000000
 background 	cccccc
 
 title		Buildroot ISO9660 image
-kernel		__KERNEL_PATH__
+kernel		__KERNEL_PATH__ root=/dev/sr0
 initrd		__INITRD_PATH__
 
 title		Hard Drive (first partition)
-- 
2.1.0

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

* [Buildroot] [PATCHv2 09/15] fs/iso9660: introduce new variables
  2015-06-08 22:21 [Buildroot] [PATCHv2 00/15] iso9660 support improvements Thomas Petazzoni
                   ` (7 preceding siblings ...)
  2015-06-08 22:21 ` [Buildroot] [PATCHv2 08/15] fs/iso9660: support building a real iso9660 filesystem Thomas Petazzoni
@ 2015-06-08 22:21 ` Thomas Petazzoni
  2015-06-14 15:25   ` Yann E. MORIN
  2015-06-08 22:21 ` [Buildroot] [PATCHv2 10/15] fs/iso9660: introduce bootloader choice Thomas Petazzoni
                   ` (5 subsequent siblings)
  14 siblings, 1 reply; 32+ messages in thread
From: Thomas Petazzoni @ 2015-06-08 22:21 UTC (permalink / raw)
  To: buildroot

In preparation to the introduction of the support for other
bootloaders that Grub, this commit introduces two new variables:

 - ROOTFS_ISO9660_BOOTLOADER_CONFIG_PATH, which gives the full path to
   the bootloader configuration file

 - ROOTFS_ISO9660_BOOT_IMAGE, which gives the relative path of the
   main bootloader image, as needed by genisoimage's -b option.

There are no functional changes made, as the variables are for now
always set to the same value.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 fs/iso9660/iso9660.mk | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/fs/iso9660/iso9660.mk b/fs/iso9660/iso9660.mk
index 723fe94..2e695b0 100644
--- a/fs/iso9660/iso9660.mk
+++ b/fs/iso9660/iso9660.mk
@@ -44,13 +44,17 @@ else
 ROOTFS_ISO9660_TARGET_DIR = $(TARGET_DIR)
 endif
 
+ROOTFS_ISO9660_BOOTLOADER_CONFIG_PATH = \
+	$(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/menu.lst
+ROOTFS_ISO9660_BOOT_IMAGE = boot/grub/stage2_eltorito
+
 define ROOTFS_ISO9660_PREPARATION
 	$(INSTALL) -D -m 0644 $(GRUB_DIR)/stage2/stage2_eltorito \
 		$(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/stage2_eltorito
 	$(INSTALL) -D -m 0644 $(ROOTFS_ISO9660_BOOT_MENU) \
-		$(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/menu.lst
+		$(ROOTFS_ISO9660_BOOTLOADER_CONFIG_PATH)
 	$(SED) "s%__KERNEL_PATH__%/boot/$(LINUX_IMAGE_NAME)%" \
-		$(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/menu.lst
+		$(ROOTFS_ISO9660_BOOTLOADER_CONFIG_PATH)
 endef
 
 ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_PREPARATION
@@ -58,13 +62,13 @@ ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_PREPARATION
 # Splash screen disabling
 ifeq ($(BR2_TARGET_GRUB_SPLASH),)
 define ROOTFS_ISO9660_DISABLE_SPLASHSCREEN
-	$(SED) '/^splashimage/d' $(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/menu.lst
+	$(SED) '/^splashimage/d' $(ROOTFS_ISO9660_BOOTLOADER_CONFIG_PATH)
 endef
 ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_DISABLE_SPLASHSCREEN
 endif
 
 define ROOTFS_ISO9660_DISABLE_EXTERNAL_INITRD
-	$(SED) '/__INITRD_PATH__/d'  $(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/menu.lst
+	$(SED) '/__INITRD_PATH__/d'  $(ROOTFS_ISO9660_BOOTLOADER_CONFIG_PATH)
 endef
 
 ifeq ($(ROOTFS_ISO9660_USE_INITRD),YES)
@@ -97,7 +101,7 @@ define ROOTFS_ISO9660_COPY_INITRD
 	$(INSTALL) -D -m 0644 $(BINARIES_DIR)/rootfs.cpio$(ROOTFS_CPIO_COMPRESS_EXT) \
 		$(ROOTFS_ISO9660_TARGET_DIR)/boot/initrd
 	$(SED) "s%__INITRD_PATH__%/boot/initrd%" \
-		$(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/menu.lst
+		$(ROOTFS_ISO9660_BOOTLOADER_CONFIG_PATH)
 endef
 ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_COPY_INITRD
 endif
@@ -110,7 +114,7 @@ endif # ROOTFS_ISO9660_USE_INITRD
 
 
 define ROOTFS_ISO9660_CMD
-	$(HOST_DIR)/usr/bin/genisoimage -J -R -b boot/grub/stage2_eltorito \
+	$(HOST_DIR)/usr/bin/genisoimage -J -R -b $(ROOTFS_ISO9660_BOOT_IMAGE) \
 		-no-emul-boot -boot-load-size 4 -boot-info-table \
 		-o $@ $(ROOTFS_ISO9660_TARGET_DIR)
 endef
-- 
2.1.0

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

* [Buildroot] [PATCHv2 10/15] fs/iso9660: introduce bootloader choice
  2015-06-08 22:21 [Buildroot] [PATCHv2 00/15] iso9660 support improvements Thomas Petazzoni
                   ` (8 preceding siblings ...)
  2015-06-08 22:21 ` [Buildroot] [PATCHv2 09/15] fs/iso9660: introduce new variables Thomas Petazzoni
@ 2015-06-08 22:21 ` Thomas Petazzoni
  2015-06-14 15:39   ` Yann E. MORIN
  2015-06-08 22:21 ` [Buildroot] [PATCHv2 11/15] fs/iso9660: use 'depends on' instead of 'select' for bootloader Thomas Petazzoni
                   ` (4 subsequent siblings)
  14 siblings, 1 reply; 32+ messages in thread
From: Thomas Petazzoni @ 2015-06-08 22:21 UTC (permalink / raw)
  To: buildroot

In preparation to the introduction for the support of other
bootloaders than Grub, this commit adds a "choice ... endchoice" block
with just the Grub option, and adds some conditionals in the
iso9660.mk code for the Grub specific parts.

Of course, for now those conditionals are a bit useless with just this
commit, but they become useful with the followup commits.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 fs/iso9660/Config.in  | 14 +++++++++++---
 fs/iso9660/iso9660.mk | 20 +++++++++++++++-----
 2 files changed, 26 insertions(+), 8 deletions(-)

diff --git a/fs/iso9660/Config.in b/fs/iso9660/Config.in
index e300fdb..f5e5f32 100644
--- a/fs/iso9660/Config.in
+++ b/fs/iso9660/Config.in
@@ -4,8 +4,6 @@ config BR2_TARGET_ROOTFS_ISO9660
 	depends on BR2_LINUX_KERNEL
 	select BR2_LINUX_KERNEL_INSTALL_TARGET \
 	       if (!BR2_TARGET_ROOTFS_ISO9660_INITRD && !BR2_TARGET_ROOTFS_INITRAMFS)
-	select BR2_TARGET_GRUB
-	select BR2_TARGET_GRUB_FS_ISO9660
 	help
 	  Build a bootable ISO9660 image. By default, the root
 	  filesystem is directly packed as the ISO9660 filesystem,
@@ -22,9 +20,19 @@ config BR2_TARGET_ROOTFS_ISO9660
 
 if BR2_TARGET_ROOTFS_ISO9660
 
+choice
+	prompt "Bootloader"
+
+config BR2_TARGET_ROOTFS_ISO9660_GRUB
+	bool "grub"
+	select BR2_TARGET_GRUB
+	select BR2_TARGET_GRUB_FS_ISO9660
+
+endchoice
+
 config BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU
 	string "Boot menu.lst file"
-	default "fs/iso9660/menu.lst"
+	default "fs/iso9660/menu.lst" if BR2_TARGET_ROOTFS_ISO9660_GRUB
 	help
 	  Use this option to provide a custom Grub menu.lst file. Note
 	  that the strings __KERNEL_PATH__ and __INITRD_PATH__ will
diff --git a/fs/iso9660/iso9660.mk b/fs/iso9660/iso9660.mk
index 2e695b0..6a1b214 100644
--- a/fs/iso9660/iso9660.mk
+++ b/fs/iso9660/iso9660.mk
@@ -24,7 +24,7 @@
 
 ROOTFS_ISO9660_BOOT_MENU = $(call qstrip,$(BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU))
 
-ROOTFS_ISO9660_DEPENDENCIES = grub host-cdrkit host-fakeroot linux
+ROOTFS_ISO9660_DEPENDENCIES = host-cdrkit host-fakeroot linux
 
 ifeq ($(BR2_TARGET_ROOTFS_INITRAMFS),y)
 ROOTFS_ISO9660_USE_INITRD = YES
@@ -44,28 +44,36 @@ else
 ROOTFS_ISO9660_TARGET_DIR = $(TARGET_DIR)
 endif
 
+ifeq ($(BR2_TARGET_ROOTFS_ISO9660_GRUB),y)
+ROOTFS_ISO9660_DEPENDENCIES += grub
 ROOTFS_ISO9660_BOOTLOADER_CONFIG_PATH = \
 	$(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/menu.lst
 ROOTFS_ISO9660_BOOT_IMAGE = boot/grub/stage2_eltorito
-
-define ROOTFS_ISO9660_PREPARATION
+define ROOTFS_ISO9660_INSTALL_BOOTLOADER
 	$(INSTALL) -D -m 0644 $(GRUB_DIR)/stage2/stage2_eltorito \
 		$(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/stage2_eltorito
+endef
+endif
+
+define ROOTFS_ISO9660_PREPARATION
 	$(INSTALL) -D -m 0644 $(ROOTFS_ISO9660_BOOT_MENU) \
 		$(ROOTFS_ISO9660_BOOTLOADER_CONFIG_PATH)
 	$(SED) "s%__KERNEL_PATH__%/boot/$(LINUX_IMAGE_NAME)%" \
 		$(ROOTFS_ISO9660_BOOTLOADER_CONFIG_PATH)
+	$(ROOTFS_ISO9660_INSTALL_BOOTLOADER)
 endef
 
 ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_PREPARATION
 
-# Splash screen disabling
+# Grub splash screen disabling
+ifeq ($(BR2_TARGET_ROOTFS_ISO9660_GRUB),y)
 ifeq ($(BR2_TARGET_GRUB_SPLASH),)
 define ROOTFS_ISO9660_DISABLE_SPLASHSCREEN
 	$(SED) '/^splashimage/d' $(ROOTFS_ISO9660_BOOTLOADER_CONFIG_PATH)
 endef
 ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_DISABLE_SPLASHSCREEN
 endif
+endif
 
 define ROOTFS_ISO9660_DISABLE_EXTERNAL_INITRD
 	$(SED) '/__INITRD_PATH__/d'  $(ROOTFS_ISO9660_BOOTLOADER_CONFIG_PATH)
@@ -73,7 +81,8 @@ endef
 
 ifeq ($(ROOTFS_ISO9660_USE_INITRD),YES)
 
-# Copy splashscreen to temporary filesystem
+# Copy Grub splashscreen to temporary filesystem
+ifeq ($(BR2_TARGET_ROOTFS_ISO9660_GRUB),y)
 ifeq ($(BR2_TARGET_GRUB_SPLASH),y)
 define ROOTFS_ISO9660_INSTALL_SPLASHSCREEN
 	$(INSTALL) -D -m 0644 $(TARGET_DIR)/boot/grub/splash.xpm.gz \
@@ -81,6 +90,7 @@ define ROOTFS_ISO9660_INSTALL_SPLASHSCREEN
 endef
 ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_INSTALL_SPLASHSCREEN
 endif
+endif
 
 # Copy the kernel to temporary filesystem
 define ROOTFS_ISO9660_COPY_KERNEL
-- 
2.1.0

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

* [Buildroot] [PATCHv2 11/15] fs/iso9660: use 'depends on' instead of 'select' for bootloader
  2015-06-08 22:21 [Buildroot] [PATCHv2 00/15] iso9660 support improvements Thomas Petazzoni
                   ` (9 preceding siblings ...)
  2015-06-08 22:21 ` [Buildroot] [PATCHv2 10/15] fs/iso9660: introduce bootloader choice Thomas Petazzoni
@ 2015-06-08 22:21 ` Thomas Petazzoni
  2015-06-14 15:40   ` Yann E. MORIN
  2015-06-08 22:21 ` [Buildroot] [PATCHv2 12/15] fs/iso9660: add isolinux support Thomas Petazzoni
                   ` (3 subsequent siblings)
  14 siblings, 1 reply; 32+ messages in thread
From: Thomas Petazzoni @ 2015-06-08 22:21 UTC (permalink / raw)
  To: buildroot

In preparation to the introduction of the support for other
bootloaders than Grub, this commit switches from having the iso9660
support "select" the necessary bootloader to using a "depends on".

The main motivation is that the isolinux bootloader support will
really need to do a "depends on", due to the need of having a certain
option enabled, but this option being a kconfig "choice".

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 fs/iso9660/Config.in | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/fs/iso9660/Config.in b/fs/iso9660/Config.in
index f5e5f32..cd7b175 100644
--- a/fs/iso9660/Config.in
+++ b/fs/iso9660/Config.in
@@ -2,6 +2,7 @@ config BR2_TARGET_ROOTFS_ISO9660
 	bool "iso image"
 	depends on (BR2_i386 || BR2_x86_64)
 	depends on BR2_LINUX_KERNEL
+	depends on BR2_TARGET_GRUB
 	select BR2_LINUX_KERNEL_INSTALL_TARGET \
 	       if (!BR2_TARGET_ROOTFS_ISO9660_INITRD && !BR2_TARGET_ROOTFS_INITRAMFS)
 	help
@@ -25,7 +26,7 @@ choice
 
 config BR2_TARGET_ROOTFS_ISO9660_GRUB
 	bool "grub"
-	select BR2_TARGET_GRUB
+	depends on BR2_TARGET_GRUB
 	select BR2_TARGET_GRUB_FS_ISO9660
 
 endchoice
@@ -52,6 +53,6 @@ config BR2_TARGET_ROOTFS_ISO9660_INITRD
 
 endif
 
-comment "iso image needs a Linux kernel to be built"
+comment "iso image needs a Linux kernel and grub to be built"
 	depends on BR2_i386 || BR2_x86_64
-	depends on !BR2_LINUX_KERNEL
+	depends on !BR2_LINUX_KERNEL || !BR2_TARGET_GRUB
-- 
2.1.0

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

* [Buildroot] [PATCHv2 12/15] fs/iso9660: add isolinux support
  2015-06-08 22:21 [Buildroot] [PATCHv2 00/15] iso9660 support improvements Thomas Petazzoni
                   ` (10 preceding siblings ...)
  2015-06-08 22:21 ` [Buildroot] [PATCHv2 11/15] fs/iso9660: use 'depends on' instead of 'select' for bootloader Thomas Petazzoni
@ 2015-06-08 22:21 ` Thomas Petazzoni
  2015-06-14 15:47   ` Yann E. MORIN
  2015-06-08 22:21 ` [Buildroot] [PATCHv2 13/15] fs/iso9660: add hybrid image support Thomas Petazzoni
                   ` (2 subsequent siblings)
  14 siblings, 1 reply; 32+ messages in thread
From: Thomas Petazzoni @ 2015-06-08 22:21 UTC (permalink / raw)
  To: buildroot

After all the preparation commits, this commit finally adds the
iso9660 support itself. Besides adding a new Config.in entry, a little
bit of .mk code and the isolinux.cfg default configuration, not much
is needed.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 fs/iso9660/Config.in    | 20 ++++++++++++++------
 fs/iso9660/iso9660.mk   | 11 +++++++++++
 fs/iso9660/isolinux.cfg |  5 +++++
 3 files changed, 30 insertions(+), 6 deletions(-)
 create mode 100644 fs/iso9660/isolinux.cfg

diff --git a/fs/iso9660/Config.in b/fs/iso9660/Config.in
index cd7b175..97925b9 100644
--- a/fs/iso9660/Config.in
+++ b/fs/iso9660/Config.in
@@ -2,7 +2,7 @@ config BR2_TARGET_ROOTFS_ISO9660
 	bool "iso image"
 	depends on (BR2_i386 || BR2_x86_64)
 	depends on BR2_LINUX_KERNEL
-	depends on BR2_TARGET_GRUB
+	depends on BR2_TARGET_GRUB || BR2_TARGET_SYSLINUX_ISOLINUX
 	select BR2_LINUX_KERNEL_INSTALL_TARGET \
 	       if (!BR2_TARGET_ROOTFS_ISO9660_INITRD && !BR2_TARGET_ROOTFS_INITRAMFS)
 	help
@@ -29,15 +29,22 @@ config BR2_TARGET_ROOTFS_ISO9660_GRUB
 	depends on BR2_TARGET_GRUB
 	select BR2_TARGET_GRUB_FS_ISO9660
 
+config BR2_TARGET_ROOTFS_ISO9660_ISOLINUX
+	bool "isolinux"
+	depends on BR2_TARGET_SYSLINUX_ISOLINUX
+
 endchoice
 
 config BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU
 	string "Boot menu.lst file"
 	default "fs/iso9660/menu.lst" if BR2_TARGET_ROOTFS_ISO9660_GRUB
+	default "fs/iso9660/isolinux.cfg" if BR2_TARGET_ROOTFS_ISO9660_ISOLINUX
 	help
-	  Use this option to provide a custom Grub menu.lst file. Note
-	  that the strings __KERNEL_PATH__ and __INITRD_PATH__ will
-	  automatically be replaced by the path to the kernel and
+	  Use this option to provide a custom bootloader configuration
+	  file (menu.lst for Grub, isolinux.cfg for isolinux).
+
+	  Note that the strings __KERNEL_PATH__ and __INITRD_PATH__
+	  will automatically be replaced by the path to the kernel and
 	  initrd images respectively.
 
 config BR2_TARGET_ROOTFS_ISO9660_INITRD
@@ -53,6 +60,7 @@ config BR2_TARGET_ROOTFS_ISO9660_INITRD
 
 endif
 
-comment "iso image needs a Linux kernel and grub to be built"
+comment "iso image needs a Linux kernel and one of grub or isolinux to be built"
 	depends on BR2_i386 || BR2_x86_64
-	depends on !BR2_LINUX_KERNEL || !BR2_TARGET_GRUB
+	depends on !BR2_LINUX_KERNEL || \
+		!(BR2_TARGET_GRUB || BR2_TARGET_SYSLINUX_ISOLINUX)
diff --git a/fs/iso9660/iso9660.mk b/fs/iso9660/iso9660.mk
index 6a1b214..588e07b 100644
--- a/fs/iso9660/iso9660.mk
+++ b/fs/iso9660/iso9660.mk
@@ -53,6 +53,17 @@ define ROOTFS_ISO9660_INSTALL_BOOTLOADER
 	$(INSTALL) -D -m 0644 $(GRUB_DIR)/stage2/stage2_eltorito \
 		$(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/stage2_eltorito
 endef
+else ifeq ($(BR2_TARGET_ROOTFS_ISO9660_ISOLINUX),y)
+ROOTFS_ISO9660_DEPENDENCIES += syslinux
+ROOTFS_ISO9660_BOOTLOADER_CONFIG_PATH = \
+	$(ROOTFS_ISO9660_TARGET_DIR)/isolinux/isolinux.cfg
+ROOTFS_ISO9660_BOOT_IMAGE = isolinux/isolinux.bin
+define ROOTFS_ISO9660_INSTALL_BOOTLOADER
+	$(INSTALL) -D -m 0644 $(BINARIES_DIR)/syslinux/isolinux.bin \
+		$(ROOTFS_ISO9660_TARGET_DIR)/isolinux/isolinux.bin
+	$(INSTALL) -D -m 0644 $(HOST_DIR)/usr/share/syslinux/ldlinux.c32 \
+		$(ROOTFS_ISO9660_TARGET_DIR)/isolinux/ldlinux.c32
+endef
 endif
 
 define ROOTFS_ISO9660_PREPARATION
diff --git a/fs/iso9660/isolinux.cfg b/fs/iso9660/isolinux.cfg
new file mode 100644
index 0000000..28be4fa
--- /dev/null
+++ b/fs/iso9660/isolinux.cfg
@@ -0,0 +1,5 @@
+default 1
+label 1
+      kernel __KERNEL_PATH__
+      initrd __INITRD_PATH__
+      append root=/dev/sr0
-- 
2.1.0

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

* [Buildroot] [PATCHv2 13/15] fs/iso9660: add hybrid image support
  2015-06-08 22:21 [Buildroot] [PATCHv2 00/15] iso9660 support improvements Thomas Petazzoni
                   ` (11 preceding siblings ...)
  2015-06-08 22:21 ` [Buildroot] [PATCHv2 12/15] fs/iso9660: add isolinux support Thomas Petazzoni
@ 2015-06-08 22:21 ` Thomas Petazzoni
  2015-06-14 15:49   ` Yann E. MORIN
                     ` (2 more replies)
  2015-06-08 22:21 ` [Buildroot] [PATCHv2 14/15] grub2: prepare and install El Torito image Thomas Petazzoni
  2015-06-08 22:21 ` [Buildroot] [PATCHv2 15/15] fs/iso9660: add support for grub2 Thomas Petazzoni
  14 siblings, 3 replies; 32+ messages in thread
From: Thomas Petazzoni @ 2015-06-08 22:21 UTC (permalink / raw)
  To: buildroot

This commit adds a new option, which allows, when isolinux is used as
the bootloader, to generate an "hybrid" ISO image. Such images can
either be booted from CD-ROM or from USB keys. It simply uses the
isohybrid tool provided by syslinux.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 fs/iso9660/Config.in  | 9 +++++++++
 fs/iso9660/iso9660.mk | 8 ++++++++
 2 files changed, 17 insertions(+)

diff --git a/fs/iso9660/Config.in b/fs/iso9660/Config.in
index 97925b9..6f057ea 100644
--- a/fs/iso9660/Config.in
+++ b/fs/iso9660/Config.in
@@ -58,6 +58,15 @@ config BR2_TARGET_ROOTFS_ISO9660_INITRD
 	  contain a kernel image, an initrd image (unless an initramfs
 	  linked into the kernel is used) and the bootloader.
 
+config BR2_TARGET_ROOTFS_ISO9660_HYBRID
+	bool "Build hybrid image"
+	depends on BR2_TARGET_ROOTFS_ISO9660_ISOLINUX
+	help
+	  Enable this option to build an hybrid image, i.e an image
+	  which can either be booted from a CD-ROM or from a device
+	  which BIOS considers a hard disk or ZIP disk, e.g. a USB key
+	  or similar.
+
 endif
 
 comment "iso image needs a Linux kernel and one of grub or isolinux to be built"
diff --git a/fs/iso9660/iso9660.mk b/fs/iso9660/iso9660.mk
index 588e07b..4f4abea 100644
--- a/fs/iso9660/iso9660.mk
+++ b/fs/iso9660/iso9660.mk
@@ -140,4 +140,12 @@ define ROOTFS_ISO9660_CMD
 		-o $@ $(ROOTFS_ISO9660_TARGET_DIR)
 endef
 
+ifeq ($(BR2_TARGET_ROOTFS_ISO9660_HYBRID),y)
+define ROOTFS_ISO9660_GEN_HYBRID
+	$(HOST_DIR)/usr/bin/isohybrid -t 0x96 $@
+endef
+
+ROOTFS_ISO9660_POST_GEN_HOOKS += ROOTFS_ISO9660_GEN_HYBRID
+endif
+
 $(eval $(call ROOTFS_TARGET,iso9660))
-- 
2.1.0

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

* [Buildroot] [PATCHv2 14/15] grub2: prepare and install El Torito image
  2015-06-08 22:21 [Buildroot] [PATCHv2 00/15] iso9660 support improvements Thomas Petazzoni
                   ` (12 preceding siblings ...)
  2015-06-08 22:21 ` [Buildroot] [PATCHv2 13/15] fs/iso9660: add hybrid image support Thomas Petazzoni
@ 2015-06-08 22:21 ` Thomas Petazzoni
  2015-06-14 15:50   ` Yann E. MORIN
  2015-06-08 22:21 ` [Buildroot] [PATCHv2 15/15] fs/iso9660: add support for grub2 Thomas Petazzoni
  14 siblings, 1 reply; 32+ messages in thread
From: Thomas Petazzoni @ 2015-06-08 22:21 UTC (permalink / raw)
  To: buildroot

In order to support ISO9660 bootable images that rely on Grub 2, this
commit modifies thr Grub 2 makefile to generate and install an El
Torito image. Such an image is simply produced by concatenating the
cdboot.img provided by Grub 2, and the Grub 2 image generated by
Buildroot using grub-mkimage.

Since this action is so simple and cost-free, we don't bother adding a
Grub 2 sub-option for that, and simply generate the El Torito image
unconditionally.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 boot/grub2/grub2.mk | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/boot/grub2/grub2.mk b/boot/grub2/grub2.mk
index 697f0ad..280b4d6 100644
--- a/boot/grub2/grub2.mk
+++ b/boot/grub2/grub2.mk
@@ -76,6 +76,8 @@ define GRUB2_IMAGE_INSTALLATION
 		-p "$(GRUB2_PREFIX)" \
 		$(if $(GRUB2_BUILTIN_CONFIG),-c $(GRUB2_BUILTIN_CONFIG)) \
 		$(GRUB2_BUILTIN_MODULES)
+	cat $(HOST_DIR)/usr/lib/grub/$(GRUB2_TUPLE)/cdboot.img $(GRUB2_IMAGE) > \
+		$(BINARIES_DIR)/grub-eltorito.img
 	mkdir -p $(dir $(GRUB2_CFG))
 	$(INSTALL) -D -m 0644 boot/grub2/grub.cfg $(GRUB2_CFG)
 endef
-- 
2.1.0

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

* [Buildroot] [PATCHv2 15/15] fs/iso9660: add support for grub2
  2015-06-08 22:21 [Buildroot] [PATCHv2 00/15] iso9660 support improvements Thomas Petazzoni
                   ` (13 preceding siblings ...)
  2015-06-08 22:21 ` [Buildroot] [PATCHv2 14/15] grub2: prepare and install El Torito image Thomas Petazzoni
@ 2015-06-08 22:21 ` Thomas Petazzoni
  2015-06-14 15:56   ` Yann E. MORIN
  14 siblings, 1 reply; 32+ messages in thread
From: Thomas Petazzoni @ 2015-06-08 22:21 UTC (permalink / raw)
  To: buildroot

After having extended the iso9660 support to allow isolinux as an
alternative to grub, this commit adds grub2 as a third
alternative. With the previous work done to support isolinux, adding
support for grub2 is fairly trivial.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 fs/iso9660/Config.in  | 18 +++++++++++++++---
 fs/iso9660/grub.cfg   |  7 +++++++
 fs/iso9660/iso9660.mk |  9 +++++++++
 3 files changed, 31 insertions(+), 3 deletions(-)
 create mode 100644 fs/iso9660/grub.cfg

diff --git a/fs/iso9660/Config.in b/fs/iso9660/Config.in
index 6f057ea..7e1ddd6 100644
--- a/fs/iso9660/Config.in
+++ b/fs/iso9660/Config.in
@@ -2,7 +2,9 @@ config BR2_TARGET_ROOTFS_ISO9660
 	bool "iso image"
 	depends on (BR2_i386 || BR2_x86_64)
 	depends on BR2_LINUX_KERNEL
-	depends on BR2_TARGET_GRUB || BR2_TARGET_SYSLINUX_ISOLINUX
+	depends on BR2_TARGET_GRUB || \
+		BR2_TARGET_GRUB2 || \
+		BR2_TARGET_SYSLINUX_ISOLINUX
 	select BR2_LINUX_KERNEL_INSTALL_TARGET \
 	       if (!BR2_TARGET_ROOTFS_ISO9660_INITRD && !BR2_TARGET_ROOTFS_INITRAMFS)
 	help
@@ -29,6 +31,15 @@ config BR2_TARGET_ROOTFS_ISO9660_GRUB
 	depends on BR2_TARGET_GRUB
 	select BR2_TARGET_GRUB_FS_ISO9660
 
+config BR2_TARGET_ROOTFS_ISO9660_GRUB2
+	bool "grub2"
+	depends on BR2_TARGET_GRUB2
+	help
+	  Use Grub 2 as the bootloader for the ISO9660 image. Make
+	  sure to enable the 'iso9660' module in
+	  BR2_TARGET_GRUB2_BUILTIN_MODULES and to use 'cd' as the boot
+	  partition in BR2_TARGET_GRUB2_BOOT_PARTITION=.
+
 config BR2_TARGET_ROOTFS_ISO9660_ISOLINUX
 	bool "isolinux"
 	depends on BR2_TARGET_SYSLINUX_ISOLINUX
@@ -38,6 +49,7 @@ endchoice
 config BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU
 	string "Boot menu.lst file"
 	default "fs/iso9660/menu.lst" if BR2_TARGET_ROOTFS_ISO9660_GRUB
+	default "fs/iso9660/grub.cfg" if BR2_TARGET_ROOTFS_ISO9660_GRUB2
 	default "fs/iso9660/isolinux.cfg" if BR2_TARGET_ROOTFS_ISO9660_ISOLINUX
 	help
 	  Use this option to provide a custom bootloader configuration
@@ -69,7 +81,7 @@ config BR2_TARGET_ROOTFS_ISO9660_HYBRID
 
 endif
 
-comment "iso image needs a Linux kernel and one of grub or isolinux to be built"
+comment "iso image needs a Linux kernel and one of grub, grub2 or isolinux to be built"
 	depends on BR2_i386 || BR2_x86_64
 	depends on !BR2_LINUX_KERNEL || \
-		!(BR2_TARGET_GRUB || BR2_TARGET_SYSLINUX_ISOLINUX)
+		!(BR2_TARGET_GRUB || BR2_TARGET_GRUB2 || BR2_TARGET_SYSLINUX_ISOLINUX)
diff --git a/fs/iso9660/grub.cfg b/fs/iso9660/grub.cfg
new file mode 100644
index 0000000..90e1039
--- /dev/null
+++ b/fs/iso9660/grub.cfg
@@ -0,0 +1,7 @@
+set default="0"
+set timeout="5"
+
+menuentry "Buildroot" {
+	linux __KERNEL_PATH__ root=/dev/sr0
+	initrd __INITRD_PATH__
+}
diff --git a/fs/iso9660/iso9660.mk b/fs/iso9660/iso9660.mk
index 4f4abea..6ed979c 100644
--- a/fs/iso9660/iso9660.mk
+++ b/fs/iso9660/iso9660.mk
@@ -53,6 +53,15 @@ define ROOTFS_ISO9660_INSTALL_BOOTLOADER
 	$(INSTALL) -D -m 0644 $(GRUB_DIR)/stage2/stage2_eltorito \
 		$(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/stage2_eltorito
 endef
+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
 else ifeq ($(BR2_TARGET_ROOTFS_ISO9660_ISOLINUX),y)
 ROOTFS_ISO9660_DEPENDENCIES += syslinux
 ROOTFS_ISO9660_BOOTLOADER_CONFIG_PATH = \
-- 
2.1.0

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

* [Buildroot] [PATCHv2 02/15] fs/iso9660: convert to the filesystem infrastructure
  2015-06-08 22:21 ` [Buildroot] [PATCHv2 02/15] fs/iso9660: convert to the filesystem infrastructure Thomas Petazzoni
@ 2015-06-14 14:52   ` Yann E. MORIN
  0 siblings, 0 replies; 32+ messages in thread
From: Yann E. MORIN @ 2015-06-14 14:52 UTC (permalink / raw)
  To: buildroot

Thomas, All,

On 2015-06-09 00:21 +0200, Thomas Petazzoni spake thusly:
> This commit converts the iso9660 logic to the common rootfs
> infrastructure. What previously prevented it from being converted is
> that the iso9660 logic needed to remove a temporary folder after the
> image has been created.
> 
> However, since Buildroot typically keeps build artefacts around, this
> commit changes the logic to keep this temporary folder around. Thanks
> to this change, converting to the common rootfs infrastructure becomes
> possible.
> 
> In addition, the temporary folder is renamed from $(BUILD_DIR)/iso9660
> to the more descriptive $(BUILD_DIR)/rootfs-iso9660.tmp.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

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

Regards,
Yann E. MORIN.

> ---
>  fs/iso9660/iso9660.mk | 68 +++++++++++++++++++++++----------------------------
>  1 file changed, 31 insertions(+), 37 deletions(-)
> 
> diff --git a/fs/iso9660/iso9660.mk b/fs/iso9660/iso9660.mk
> index 4ccfce9..35b0fe5 100644
> --- a/fs/iso9660/iso9660.mk
> +++ b/fs/iso9660/iso9660.mk
> @@ -2,59 +2,53 @@
>  #
>  # Build the iso96600 root filesystem image
>  #
> -# Cannot be converted to the ROOTFS_TARGET infrastructure, because of
> -# the temporary construction in ISO9660_TARGET_DIR.
> -#
>  ################################################################################
>  
> -ISO9660_TARGET_DIR = $(BUILD_DIR)/iso9660
> +ISO9660_TARGET_DIR = $(BUILD_DIR)/rootfs-iso9660.tmp
>  ISO9660_BOOT_MENU := $(call qstrip,$(BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU))
>  
>  ROOTFS_ISO9660_DEPENDENCIES = grub host-cdrkit host-fakeroot linux rootfs-cpio
>  
> -$(BINARIES_DIR)/rootfs.iso9660: $(ROOTFS_ISO9660_DEPENDENCIES)
> -	@$(call MESSAGE,"Generating root filesystem image rootfs.iso9660")
> -	$(INSTALL) -D -m 0644 $(GRUB_DIR)/stage2/stage2_eltorito \
> -		$(ISO9660_TARGET_DIR)/boot/grub/stage2_eltorito
> -	$(INSTALL) -D -m 0644 $(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
> +ifeq ($(BR2_TARGET_GRUB_SPLASH),y)
> +define ROOTFS_ISO9660_SPLASHSCREEN
>  	$(INSTALL) -D -m 0644 boot/grub/splash.xpm.gz \
>  		$(ISO9660_TARGET_DIR)/splash.xpm.gz
> +endef
> +else
> +define ROOTFS_ISO9660_SPLASHSCREEN
> +	$(SED) '/^splashimage/d' $(ISO9660_TARGET_DIR)/boot/grub/menu.lst
> +endef
>  endif
> -	$(INSTALL) -D -m 0644 $(LINUX_IMAGE_PATH) $(ISO9660_TARGET_DIR)/kernel
> +
>  ifeq ($(BR2_TARGET_ROOTFS_INITRAMFS),y)
> +define ROOTFS_ISO9660_INITRD
>  	$(SED) '/initrd/d'  $(ISO9660_TARGET_DIR)/boot/grub/menu.lst
> +endef
>  else
> +define ROOTFS_ISO9660_INITRD
>  	$(INSTALL) -D -m 0644 $(BINARIES_DIR)/rootfs.cpio$(ROOTFS_CPIO_COMPRESS_EXT) \
>  		$(ISO9660_TARGET_DIR)/initrd
> +endef
>  endif
> -	# Use fakeroot to pretend all target binaries are owned by root
> -	rm -f $(FAKEROOT_SCRIPT)
> -	echo "chown -h -R 0:0 $(ISO9660_TARGET_DIR)" >> $(FAKEROOT_SCRIPT)
> -	# Use fakeroot so mkisofs believes the previous fakery
> -	echo "$(HOST_DIR)/usr/bin/genisoimage -R -b boot/grub/stage2_eltorito -no-emul-boot " \
> -		"-boot-load-size 4 -boot-info-table -o $@ $(ISO9660_TARGET_DIR)" \
> -		>> $(FAKEROOT_SCRIPT)
> -	chmod a+x $(FAKEROOT_SCRIPT)
> -	$(HOST_DIR)/usr/bin/fakeroot -- $(FAKEROOT_SCRIPT)
> -	- at rm -f $(FAKEROOT_SCRIPT)
> -	- at rm -rf $(ISO9660_TARGET_DIR)
>  
> -rootfs-iso9660: $(BINARIES_DIR)/rootfs.iso9660
> +define ROOTFS_ISO9660_PREPARATION
> +	$(RM) -rf $(ISO9660_TARGET_DIR)
> +	mkdir -p $(ISO9660_TARGET_DIR)
> +	$(INSTALL) -D -m 0644 $(GRUB_DIR)/stage2/stage2_eltorito \
> +		$(ISO9660_TARGET_DIR)/boot/grub/stage2_eltorito
> +	$(INSTALL) -D -m 0644 $(ISO9660_BOOT_MENU) \
> +		$(ISO9660_TARGET_DIR)/boot/grub/menu.lst
> +	$(INSTALL) -D -m 0644 $(LINUX_IMAGE_PATH) $(ISO9660_TARGET_DIR)/kernel
> +	$(ROOTFS_ISO9660_SPLASHSCREEN)
> +	$(ROOTFS_ISO9660_INITRD)
> +endef
>  
> -rootfs-iso9660-show-depends:
> -	@echo $(ROOTFS_ISO9660_DEPENDENCIES)
> +ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_PREPARATION
>  
> -.PHONY: rootfs-iso9660 rootfs-iso9660-show-depends
> +define ROOTFS_ISO9660_CMD
> +	$(HOST_DIR)/usr/bin/genisoimage -R -b boot/grub/stage2_eltorito \
> +		-no-emul-boot -boot-load-size 4 -boot-info-table \
> +		-o $@ $(ISO9660_TARGET_DIR)
> +endef
>  
> -################################################################################
> -#
> -# Toplevel Makefile options
> -#
> -################################################################################
> -ifeq ($(BR2_TARGET_ROOTFS_ISO9660),y)
> -TARGETS_ROOTFS += rootfs-iso9660
> -endif
> +$(eval $(call ROOTFS_TARGET,iso9660))
> -- 
> 2.1.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] 32+ messages in thread

* [Buildroot] [PATCHv2 06/15] fs/iso9660: get grub splash from $(TARGET_DIR)
  2015-06-08 22:21 ` [Buildroot] [PATCHv2 06/15] fs/iso9660: get grub splash from $(TARGET_DIR) Thomas Petazzoni
@ 2015-06-14 14:59   ` Yann E. MORIN
  0 siblings, 0 replies; 32+ messages in thread
From: Yann E. MORIN @ 2015-06-14 14:59 UTC (permalink / raw)
  To: buildroot

Thomas, All,

On 2015-06-09 00:21 +0200, Thomas Petazzoni spake thusly:
> Instead of using directly the splash image from the Buildroot source
> directory boot/grub, this commit changes the iso9660 logic to use the
> splash image installed in $(TARGET_DIR)/boot/grub.
> 
> This effectively allows a user to use a custom splash image by
> installing it to $(TARGET_DIR) through a rootfs overlay or using a
> post-build script.
> 
> Suggested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

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

Regards,
Yann E. MORIN.

> ---
>  fs/iso9660/iso9660.mk | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/iso9660/iso9660.mk b/fs/iso9660/iso9660.mk
> index b3e6b9d..b313c65 100644
> --- a/fs/iso9660/iso9660.mk
> +++ b/fs/iso9660/iso9660.mk
> @@ -11,7 +11,7 @@ ROOTFS_ISO9660_DEPENDENCIES = grub host-cdrkit host-fakeroot linux rootfs-cpio
>  
>  ifeq ($(BR2_TARGET_GRUB_SPLASH),y)
>  define ROOTFS_ISO9660_SPLASHSCREEN
> -	$(INSTALL) -D -m 0644 boot/grub/splash.xpm.gz \
> +	$(INSTALL) -D -m 0644 $(TARGET_DIR)/boot/grub/splash.xpm.gz \
>  		$(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/splash.xpm.gz
>  endef
>  else
> -- 
> 2.1.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] 32+ messages in thread

* [Buildroot] [PATCHv2 08/15] fs/iso9660: support building a real iso9660 filesystem
  2015-06-08 22:21 ` [Buildroot] [PATCHv2 08/15] fs/iso9660: support building a real iso9660 filesystem Thomas Petazzoni
@ 2015-06-14 15:17   ` Yann E. MORIN
  2015-06-14 21:20     ` Thomas Petazzoni
  0 siblings, 1 reply; 32+ messages in thread
From: Yann E. MORIN @ 2015-06-14 15:17 UTC (permalink / raw)
  To: buildroot

Thomas, All,

On 2015-06-09 00:21 +0200, Thomas Petazzoni spake thusly:
> Until now, the iso9660 filesystem handling only supported using an
> initrd/initramfs to store the root filesystem, which is very different
> from what we do with the other filesystems.
> 
> This commit changes the iso9660 logic to also allow using directly an
> iso9660 filesystem to store the root filesystem. A new option,
> BR2_TARGET_ROOTFS_ISO9660_INITRD, is created to tell the iso9660 that
> we want to use an initrd and not directly the root filesystem in
> iso9660 format. This option defaults to 'y' to preserve the existing
> behavior.
> 
> After this commit, we therefore have three possibilities:
> 
>  * BR2_TARGET_ROOTFS_ISO9660=y, with BR2_TARGET_ROOTFS_INITRAMFS and
>    BR2_TARGET_ROOTFS_ISO9660_INITRD disabled. In this case, the
>    iso9660 filesystem is directly the contents of the root filesystem
>    (since is possible thanks to the Rockridge extensions that were
>    already enabled using the -R option of genisoimage). Obviously, it
>    means that the root filesystem is read-only.
> 
>  * BR2_TARGET_ROOTFS_ISO9660=y and BR2_TARGET_ROOTFS_INITRAMFS=y (the
>    value of BR2_TARGET_ROOTFS_ISO9660_INITRD doesn't matter). In this
>    case, the root filesystem is already linked into the kernel image
>    itself, as an initramfs. So the iso9660 filesystem doesn't contain
>    the root filesystem as is, but just the bootloader and the kernel
>    image.
> 
>  * BR2_TARGET_ROOTFS_ISO9660=y, BR2_TARGET_ROOTFS_ISO9660_INITRD=y and
>    BR2_TARGET_ROOTFS_INITRAMFS disabled. In this case, a separate
>    initrd is used. The iso9660 filesystem only contains the
>    bootloader, the kernel and the initrd.
> 
> In order to support the first case out of the box, root=/dev/sr0 is
> added on the kernel command line in the example Grub configuration
> file, so that the kernel knows where the root filesystem is
> located. This argument is ignored when initrd/initramfs are used.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

I have to admit I was not very confortable reviewing this patch, because
the splashscreen settign are split in two locations, and checking all
possible code paths (not that many, but still) to ensure splashscreen
was either properly copied or disabled, was not trivial.

But it looks OK. so:

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

Regards,
Yann E. MORIN.

> ---
>  fs/iso9660/Config.in  |  27 ++++++++++++-
>  fs/iso9660/iso9660.mk | 109 ++++++++++++++++++++++++++++++++++++++------------
>  fs/iso9660/menu.lst   |   2 +-
>  3 files changed, 110 insertions(+), 28 deletions(-)
> 
> diff --git a/fs/iso9660/Config.in b/fs/iso9660/Config.in
> index 111158b..e300fdb 100644
> --- a/fs/iso9660/Config.in
> +++ b/fs/iso9660/Config.in
> @@ -2,11 +2,23 @@ config BR2_TARGET_ROOTFS_ISO9660
>  	bool "iso image"
>  	depends on (BR2_i386 || BR2_x86_64)
>  	depends on BR2_LINUX_KERNEL
> -	select BR2_TARGET_ROOTFS_CPIO
> +	select BR2_LINUX_KERNEL_INSTALL_TARGET \
> +	       if (!BR2_TARGET_ROOTFS_ISO9660_INITRD && !BR2_TARGET_ROOTFS_INITRAMFS)
>  	select BR2_TARGET_GRUB
>  	select BR2_TARGET_GRUB_FS_ISO9660
>  	help
> -	  Build a bootable iso9660 image
> +	  Build a bootable ISO9660 image. By default, the root
> +	  filesystem is directly packed as the ISO9660 filesystem,
> +	  which means the root filesystem will be read-only. It
> +	  requires ISO9660 filesystem support and CDROM support in the
> +	  kernel.
> +
> +	  However, if BR2_TARGET_ROOTFS_INITRAMFS or
> +	  BR2_TARGET_ROOTFS_ISO9660_INITRD have been enabled, the
> +	  ISO9660 filesystem will only contain a kernel image and
> +	  optionally an external initrd image. In this case, the
> +	  filesystem being in RAM, it will be read/write. No ISO9660
> +	  or CDROM support is needed in the kernel.
>  
>  if BR2_TARGET_ROOTFS_ISO9660
>  
> @@ -19,6 +31,17 @@ config BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU
>  	  automatically be replaced by the path to the kernel and
>  	  initrd images respectively.
>  
> +config BR2_TARGET_ROOTFS_ISO9660_INITRD
> +	bool "Use initrd"
> +	default y
> +	select BR2_TARGET_ROOTFS_CPIO
> +	help
> +	  Enable this option to have the root filesystem bundled as an
> +	  initrd/initramfs rather than directly as the ISO9660
> +	  filesystem. With this option enabled, the ISO9660 will only
> +	  contain a kernel image, an initrd image (unless an initramfs
> +	  linked into the kernel is used) and the bootloader.
> +
>  endif
>  
>  comment "iso image needs a Linux kernel to be built"
> diff --git a/fs/iso9660/iso9660.mk b/fs/iso9660/iso9660.mk
> index 035561d..723fe94 100644
> --- a/fs/iso9660/iso9660.mk
> +++ b/fs/iso9660/iso9660.mk
> @@ -4,51 +4,110 @@
>  #
>  ################################################################################
>  
> -ROOTFS_ISO9660_TARGET_DIR = $(BUILD_DIR)/rootfs-iso9660.tmp
> +#
> +# We need to handle three cases:
> +#
> +#  1. The ISO9660 filesystem will really be the real root filesystem
> +#     itself. This is when BR2_TARGET_ROOTFS_ISO9660_INITRD is
> +#     disabled.
> +#
> +#  2. The ISO9660 filesystem will be a filesystem with just a kernel
> +#     image, initrd and grub. This is when
> +#     BR2_TARGET_ROOTFS_ISO9660_INITRD is enabled, but
> +#     BR2_TARGET_ROOTFS_INITRAMFS is disabled.
> +#
> +#  3. The ISO9660 filesystem will be a filesystem with just a kernel
> +#     image and grub. This is like (2), except that the initrd is
> +#     built into the kernel image. This is when
> +#     BR2_TARGET_ROOTFS_INITRAMFS is enabled (regardless of the value
> +#     of BR2_TARGET_ROOTFS_ISO9660_INITRD).
> +
>  ROOTFS_ISO9660_BOOT_MENU = $(call qstrip,$(BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU))
>  
> -ROOTFS_ISO9660_DEPENDENCIES = grub host-cdrkit host-fakeroot linux rootfs-cpio
> +ROOTFS_ISO9660_DEPENDENCIES = grub host-cdrkit host-fakeroot linux
>  
> -ifeq ($(BR2_TARGET_GRUB_SPLASH),y)
> -define ROOTFS_ISO9660_SPLASHSCREEN
> -	$(INSTALL) -D -m 0644 $(TARGET_DIR)/boot/grub/splash.xpm.gz \
> -		$(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/splash.xpm.gz
> +ifeq ($(BR2_TARGET_ROOTFS_INITRAMFS),y)
> +ROOTFS_ISO9660_USE_INITRD = YES
> +endif
> +
> +ifeq ($(BR2_TARGET_ROOTFS_ISO9660_INITRD),y)
> +ROOTFS_ISO9660_USE_INITRD = YES
> +endif
> +
> +ifeq ($(ROOTFS_ISO9660_USE_INITRD),YES)
> +ROOTFS_ISO9660_TARGET_DIR = $(BUILD_DIR)/rootfs-iso9660.tmp
> +define ROOTFS_ISO9660_CREATE_TEMPDIR
> +	$(RM) -rf $(ROOTFS_ISO9660_TARGET_DIR)
> +	mkdir -p $(ROOTFS_ISO9660_TARGET_DIR)
>  endef
>  else
> -define ROOTFS_ISO9660_SPLASHSCREEN
> +ROOTFS_ISO9660_TARGET_DIR = $(TARGET_DIR)
> +endif
> +
> +define ROOTFS_ISO9660_PREPARATION
> +	$(INSTALL) -D -m 0644 $(GRUB_DIR)/stage2/stage2_eltorito \
> +		$(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/stage2_eltorito
> +	$(INSTALL) -D -m 0644 $(ROOTFS_ISO9660_BOOT_MENU) \
> +		$(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/menu.lst
> +	$(SED) "s%__KERNEL_PATH__%/boot/$(LINUX_IMAGE_NAME)%" \
> +		$(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/menu.lst
> +endef
> +
> +ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_PREPARATION
> +
> +# Splash screen disabling
> +ifeq ($(BR2_TARGET_GRUB_SPLASH),)
> +define ROOTFS_ISO9660_DISABLE_SPLASHSCREEN
>  	$(SED) '/^splashimage/d' $(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/menu.lst
>  endef
> +ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_DISABLE_SPLASHSCREEN
>  endif
>  
> -ifeq ($(BR2_TARGET_ROOTFS_INITRAMFS),y)
> -define ROOTFS_ISO9660_INITRD
> +define ROOTFS_ISO9660_DISABLE_EXTERNAL_INITRD
>  	$(SED) '/__INITRD_PATH__/d'  $(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/menu.lst
>  endef
> +
> +ifeq ($(ROOTFS_ISO9660_USE_INITRD),YES)
> +
> +# Copy splashscreen to temporary filesystem
> +ifeq ($(BR2_TARGET_GRUB_SPLASH),y)
> +define ROOTFS_ISO9660_INSTALL_SPLASHSCREEN
> +	$(INSTALL) -D -m 0644 $(TARGET_DIR)/boot/grub/splash.xpm.gz \
> +		$(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/splash.xpm.gz
> +endef
> +ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_INSTALL_SPLASHSCREEN
> +endif
> +
> +# Copy the kernel to temporary filesystem
> +define ROOTFS_ISO9660_COPY_KERNEL
> +	$(INSTALL) -D -m 0644 $(LINUX_IMAGE_PATH) \
> +		$(ROOTFS_ISO9660_TARGET_DIR)/boot/$(LINUX_IMAGE_NAME)
> +endef
> +
> +ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_COPY_KERNEL
> +
> +# If initramfs is used, disable loading the initrd as the rootfs is
> +# already inside the kernel image. Otherwise, make sure a cpio is
> +# generated and use it as the initrd.
> +ifeq ($(BR2_TARGET_ROOTFS_INITRAMFS),y)
> +ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_DISABLE_EXTERNAL_INITRD
>  else
> -define ROOTFS_ISO9660_INITRD
> +ROOTFS_ISO9660_DEPENDENCIES += rootfs-cpio
> +define ROOTFS_ISO9660_COPY_INITRD
>  	$(INSTALL) -D -m 0644 $(BINARIES_DIR)/rootfs.cpio$(ROOTFS_CPIO_COMPRESS_EXT) \
>  		$(ROOTFS_ISO9660_TARGET_DIR)/boot/initrd
>  	$(SED) "s%__INITRD_PATH__%/boot/initrd%" \
>  		$(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/menu.lst
>  endef
> +ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_COPY_INITRD
>  endif
>  
> -define ROOTFS_ISO9660_PREPARATION
> -	$(RM) -rf $(ROOTFS_ISO9660_TARGET_DIR)
> -	mkdir -p $(ROOTFS_ISO9660_TARGET_DIR)
> -	$(INSTALL) -D -m 0644 $(GRUB_DIR)/stage2/stage2_eltorito \
> -		$(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/stage2_eltorito
> -	$(INSTALL) -D -m 0644 $(ROOTFS_ISO9660_BOOT_MENU) \
> -		$(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/menu.lst
> -	$(INSTALL) -D -m 0644 $(LINUX_IMAGE_PATH) \
> -		$(ROOTFS_ISO9660_TARGET_DIR)/boot/$(LINUX_IMAGE_NAME)
> -	$(SED) "s%__KERNEL_PATH__%/boot/$(LINUX_IMAGE_NAME)%" \
> -		$(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/menu.lst
> -	$(ROOTFS_ISO9660_SPLASHSCREEN)
> -	$(ROOTFS_ISO9660_INITRD)
> -endef
> +else # ROOTFS_ISO9660_USE_INITRD
> +
> +ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_DISABLE_EXTERNAL_INITRD
> +
> +endif # ROOTFS_ISO9660_USE_INITRD
>  
> -ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_PREPARATION
>  
>  define ROOTFS_ISO9660_CMD
>  	$(HOST_DIR)/usr/bin/genisoimage -J -R -b boot/grub/stage2_eltorito \
> diff --git a/fs/iso9660/menu.lst b/fs/iso9660/menu.lst
> index 8e8309f..eb1ecef 100644
> --- a/fs/iso9660/menu.lst
> +++ b/fs/iso9660/menu.lst
> @@ -12,7 +12,7 @@ foreground 	000000
>  background 	cccccc
>  
>  title		Buildroot ISO9660 image
> -kernel		__KERNEL_PATH__
> +kernel		__KERNEL_PATH__ root=/dev/sr0
>  initrd		__INITRD_PATH__
>  
>  title		Hard Drive (first partition)
> -- 
> 2.1.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] 32+ messages in thread

* [Buildroot] [PATCHv2 09/15] fs/iso9660: introduce new variables
  2015-06-08 22:21 ` [Buildroot] [PATCHv2 09/15] fs/iso9660: introduce new variables Thomas Petazzoni
@ 2015-06-14 15:25   ` Yann E. MORIN
  0 siblings, 0 replies; 32+ messages in thread
From: Yann E. MORIN @ 2015-06-14 15:25 UTC (permalink / raw)
  To: buildroot

Thomas, All,

On 2015-06-09 00:21 +0200, Thomas Petazzoni spake thusly:
> In preparation to the introduction of the support for other
> bootloaders that Grub, this commit introduces two new variables:
> 
>  - ROOTFS_ISO9660_BOOTLOADER_CONFIG_PATH, which gives the full path to
>    the bootloader configuration file
> 
>  - ROOTFS_ISO9660_BOOT_IMAGE, which gives the relative path of the
>    main bootloader image, as needed by genisoimage's -b option.
> 
> There are no functional changes made, as the variables are for now
> always set to the same value.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

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

Regards,
Yann E. MORIN.

> ---
>  fs/iso9660/iso9660.mk | 16 ++++++++++------
>  1 file changed, 10 insertions(+), 6 deletions(-)
> 
> diff --git a/fs/iso9660/iso9660.mk b/fs/iso9660/iso9660.mk
> index 723fe94..2e695b0 100644
> --- a/fs/iso9660/iso9660.mk
> +++ b/fs/iso9660/iso9660.mk
> @@ -44,13 +44,17 @@ else
>  ROOTFS_ISO9660_TARGET_DIR = $(TARGET_DIR)
>  endif
>  
> +ROOTFS_ISO9660_BOOTLOADER_CONFIG_PATH = \
> +	$(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/menu.lst
> +ROOTFS_ISO9660_BOOT_IMAGE = boot/grub/stage2_eltorito
> +
>  define ROOTFS_ISO9660_PREPARATION
>  	$(INSTALL) -D -m 0644 $(GRUB_DIR)/stage2/stage2_eltorito \
>  		$(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/stage2_eltorito
>  	$(INSTALL) -D -m 0644 $(ROOTFS_ISO9660_BOOT_MENU) \
> -		$(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/menu.lst
> +		$(ROOTFS_ISO9660_BOOTLOADER_CONFIG_PATH)
>  	$(SED) "s%__KERNEL_PATH__%/boot/$(LINUX_IMAGE_NAME)%" \
> -		$(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/menu.lst
> +		$(ROOTFS_ISO9660_BOOTLOADER_CONFIG_PATH)
>  endef
>  
>  ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_PREPARATION
> @@ -58,13 +62,13 @@ ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_PREPARATION
>  # Splash screen disabling
>  ifeq ($(BR2_TARGET_GRUB_SPLASH),)
>  define ROOTFS_ISO9660_DISABLE_SPLASHSCREEN
> -	$(SED) '/^splashimage/d' $(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/menu.lst
> +	$(SED) '/^splashimage/d' $(ROOTFS_ISO9660_BOOTLOADER_CONFIG_PATH)
>  endef
>  ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_DISABLE_SPLASHSCREEN
>  endif
>  
>  define ROOTFS_ISO9660_DISABLE_EXTERNAL_INITRD
> -	$(SED) '/__INITRD_PATH__/d'  $(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/menu.lst
> +	$(SED) '/__INITRD_PATH__/d'  $(ROOTFS_ISO9660_BOOTLOADER_CONFIG_PATH)
>  endef
>  
>  ifeq ($(ROOTFS_ISO9660_USE_INITRD),YES)
> @@ -97,7 +101,7 @@ define ROOTFS_ISO9660_COPY_INITRD
>  	$(INSTALL) -D -m 0644 $(BINARIES_DIR)/rootfs.cpio$(ROOTFS_CPIO_COMPRESS_EXT) \
>  		$(ROOTFS_ISO9660_TARGET_DIR)/boot/initrd
>  	$(SED) "s%__INITRD_PATH__%/boot/initrd%" \
> -		$(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/menu.lst
> +		$(ROOTFS_ISO9660_BOOTLOADER_CONFIG_PATH)
>  endef
>  ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_COPY_INITRD
>  endif
> @@ -110,7 +114,7 @@ endif # ROOTFS_ISO9660_USE_INITRD
>  
>  
>  define ROOTFS_ISO9660_CMD
> -	$(HOST_DIR)/usr/bin/genisoimage -J -R -b boot/grub/stage2_eltorito \
> +	$(HOST_DIR)/usr/bin/genisoimage -J -R -b $(ROOTFS_ISO9660_BOOT_IMAGE) \
>  		-no-emul-boot -boot-load-size 4 -boot-info-table \
>  		-o $@ $(ROOTFS_ISO9660_TARGET_DIR)
>  endef
> -- 
> 2.1.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] 32+ messages in thread

* [Buildroot] [PATCHv2 10/15] fs/iso9660: introduce bootloader choice
  2015-06-08 22:21 ` [Buildroot] [PATCHv2 10/15] fs/iso9660: introduce bootloader choice Thomas Petazzoni
@ 2015-06-14 15:39   ` Yann E. MORIN
  0 siblings, 0 replies; 32+ messages in thread
From: Yann E. MORIN @ 2015-06-14 15:39 UTC (permalink / raw)
  To: buildroot

Thomas, All,

On 2015-06-09 00:21 +0200, Thomas Petazzoni spake thusly:
> In preparation to the introduction for the support of other
> bootloaders than Grub, this commit adds a "choice ... endchoice" block
> with just the Grub option, and adds some conditionals in the
> iso9660.mk code for the Grub specific parts.
> 
> Of course, for now those conditionals are a bit useless with just this
> commit, but they become useful with the followup commits.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

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

Regards,
Yann E. MORIN.

> ---
>  fs/iso9660/Config.in  | 14 +++++++++++---
>  fs/iso9660/iso9660.mk | 20 +++++++++++++++-----
>  2 files changed, 26 insertions(+), 8 deletions(-)
> 
> diff --git a/fs/iso9660/Config.in b/fs/iso9660/Config.in
> index e300fdb..f5e5f32 100644
> --- a/fs/iso9660/Config.in
> +++ b/fs/iso9660/Config.in
> @@ -4,8 +4,6 @@ config BR2_TARGET_ROOTFS_ISO9660
>  	depends on BR2_LINUX_KERNEL
>  	select BR2_LINUX_KERNEL_INSTALL_TARGET \
>  	       if (!BR2_TARGET_ROOTFS_ISO9660_INITRD && !BR2_TARGET_ROOTFS_INITRAMFS)
> -	select BR2_TARGET_GRUB
> -	select BR2_TARGET_GRUB_FS_ISO9660
>  	help
>  	  Build a bootable ISO9660 image. By default, the root
>  	  filesystem is directly packed as the ISO9660 filesystem,
> @@ -22,9 +20,19 @@ config BR2_TARGET_ROOTFS_ISO9660
>  
>  if BR2_TARGET_ROOTFS_ISO9660
>  
> +choice
> +	prompt "Bootloader"
> +
> +config BR2_TARGET_ROOTFS_ISO9660_GRUB
> +	bool "grub"
> +	select BR2_TARGET_GRUB
> +	select BR2_TARGET_GRUB_FS_ISO9660
> +
> +endchoice
> +
>  config BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU
>  	string "Boot menu.lst file"
> -	default "fs/iso9660/menu.lst"
> +	default "fs/iso9660/menu.lst" if BR2_TARGET_ROOTFS_ISO9660_GRUB
>  	help
>  	  Use this option to provide a custom Grub menu.lst file. Note
>  	  that the strings __KERNEL_PATH__ and __INITRD_PATH__ will
> diff --git a/fs/iso9660/iso9660.mk b/fs/iso9660/iso9660.mk
> index 2e695b0..6a1b214 100644
> --- a/fs/iso9660/iso9660.mk
> +++ b/fs/iso9660/iso9660.mk
> @@ -24,7 +24,7 @@
>  
>  ROOTFS_ISO9660_BOOT_MENU = $(call qstrip,$(BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU))
>  
> -ROOTFS_ISO9660_DEPENDENCIES = grub host-cdrkit host-fakeroot linux
> +ROOTFS_ISO9660_DEPENDENCIES = host-cdrkit host-fakeroot linux
>  
>  ifeq ($(BR2_TARGET_ROOTFS_INITRAMFS),y)
>  ROOTFS_ISO9660_USE_INITRD = YES
> @@ -44,28 +44,36 @@ else
>  ROOTFS_ISO9660_TARGET_DIR = $(TARGET_DIR)
>  endif
>  
> +ifeq ($(BR2_TARGET_ROOTFS_ISO9660_GRUB),y)
> +ROOTFS_ISO9660_DEPENDENCIES += grub
>  ROOTFS_ISO9660_BOOTLOADER_CONFIG_PATH = \
>  	$(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/menu.lst
>  ROOTFS_ISO9660_BOOT_IMAGE = boot/grub/stage2_eltorito
> -
> -define ROOTFS_ISO9660_PREPARATION
> +define ROOTFS_ISO9660_INSTALL_BOOTLOADER
>  	$(INSTALL) -D -m 0644 $(GRUB_DIR)/stage2/stage2_eltorito \
>  		$(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/stage2_eltorito
> +endef
> +endif
> +
> +define ROOTFS_ISO9660_PREPARATION
>  	$(INSTALL) -D -m 0644 $(ROOTFS_ISO9660_BOOT_MENU) \
>  		$(ROOTFS_ISO9660_BOOTLOADER_CONFIG_PATH)
>  	$(SED) "s%__KERNEL_PATH__%/boot/$(LINUX_IMAGE_NAME)%" \
>  		$(ROOTFS_ISO9660_BOOTLOADER_CONFIG_PATH)
> +	$(ROOTFS_ISO9660_INSTALL_BOOTLOADER)
>  endef
>  
>  ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_PREPARATION
>  
> -# Splash screen disabling
> +# Grub splash screen disabling
> +ifeq ($(BR2_TARGET_ROOTFS_ISO9660_GRUB),y)
>  ifeq ($(BR2_TARGET_GRUB_SPLASH),)
>  define ROOTFS_ISO9660_DISABLE_SPLASHSCREEN
>  	$(SED) '/^splashimage/d' $(ROOTFS_ISO9660_BOOTLOADER_CONFIG_PATH)
>  endef
>  ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_DISABLE_SPLASHSCREEN
>  endif
> +endif
>  
>  define ROOTFS_ISO9660_DISABLE_EXTERNAL_INITRD
>  	$(SED) '/__INITRD_PATH__/d'  $(ROOTFS_ISO9660_BOOTLOADER_CONFIG_PATH)
> @@ -73,7 +81,8 @@ endef
>  
>  ifeq ($(ROOTFS_ISO9660_USE_INITRD),YES)
>  
> -# Copy splashscreen to temporary filesystem
> +# Copy Grub splashscreen to temporary filesystem
> +ifeq ($(BR2_TARGET_ROOTFS_ISO9660_GRUB),y)
>  ifeq ($(BR2_TARGET_GRUB_SPLASH),y)
>  define ROOTFS_ISO9660_INSTALL_SPLASHSCREEN
>  	$(INSTALL) -D -m 0644 $(TARGET_DIR)/boot/grub/splash.xpm.gz \
> @@ -81,6 +90,7 @@ define ROOTFS_ISO9660_INSTALL_SPLASHSCREEN
>  endef
>  ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_INSTALL_SPLASHSCREEN
>  endif
> +endif
>  
>  # Copy the kernel to temporary filesystem
>  define ROOTFS_ISO9660_COPY_KERNEL
> -- 
> 2.1.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] 32+ messages in thread

* [Buildroot] [PATCHv2 11/15] fs/iso9660: use 'depends on' instead of 'select' for bootloader
  2015-06-08 22:21 ` [Buildroot] [PATCHv2 11/15] fs/iso9660: use 'depends on' instead of 'select' for bootloader Thomas Petazzoni
@ 2015-06-14 15:40   ` Yann E. MORIN
  0 siblings, 0 replies; 32+ messages in thread
From: Yann E. MORIN @ 2015-06-14 15:40 UTC (permalink / raw)
  To: buildroot

Thomas, All,

On 2015-06-09 00:21 +0200, Thomas Petazzoni spake thusly:
> In preparation to the introduction of the support for other
> bootloaders than Grub, this commit switches from having the iso9660
> support "select" the necessary bootloader to using a "depends on".
> 
> The main motivation is that the isolinux bootloader support will
> really need to do a "depends on", due to the need of having a certain
> option enabled, but this option being a kconfig "choice".
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

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

Regards,
Yann E. MORIN.

> ---
>  fs/iso9660/Config.in | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/iso9660/Config.in b/fs/iso9660/Config.in
> index f5e5f32..cd7b175 100644
> --- a/fs/iso9660/Config.in
> +++ b/fs/iso9660/Config.in
> @@ -2,6 +2,7 @@ config BR2_TARGET_ROOTFS_ISO9660
>  	bool "iso image"
>  	depends on (BR2_i386 || BR2_x86_64)
>  	depends on BR2_LINUX_KERNEL
> +	depends on BR2_TARGET_GRUB
>  	select BR2_LINUX_KERNEL_INSTALL_TARGET \
>  	       if (!BR2_TARGET_ROOTFS_ISO9660_INITRD && !BR2_TARGET_ROOTFS_INITRAMFS)
>  	help
> @@ -25,7 +26,7 @@ choice
>  
>  config BR2_TARGET_ROOTFS_ISO9660_GRUB
>  	bool "grub"
> -	select BR2_TARGET_GRUB
> +	depends on BR2_TARGET_GRUB
>  	select BR2_TARGET_GRUB_FS_ISO9660
>  
>  endchoice
> @@ -52,6 +53,6 @@ config BR2_TARGET_ROOTFS_ISO9660_INITRD
>  
>  endif
>  
> -comment "iso image needs a Linux kernel to be built"
> +comment "iso image needs a Linux kernel and grub to be built"
>  	depends on BR2_i386 || BR2_x86_64
> -	depends on !BR2_LINUX_KERNEL
> +	depends on !BR2_LINUX_KERNEL || !BR2_TARGET_GRUB
> -- 
> 2.1.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] 32+ messages in thread

* [Buildroot] [PATCHv2 12/15] fs/iso9660: add isolinux support
  2015-06-08 22:21 ` [Buildroot] [PATCHv2 12/15] fs/iso9660: add isolinux support Thomas Petazzoni
@ 2015-06-14 15:47   ` Yann E. MORIN
  2015-06-14 21:24     ` Thomas Petazzoni
  0 siblings, 1 reply; 32+ messages in thread
From: Yann E. MORIN @ 2015-06-14 15:47 UTC (permalink / raw)
  To: buildroot

Thomas, All,

On 2015-06-09 00:21 +0200, Thomas Petazzoni spake thusly:
> After all the preparation commits, this commit finally adds the
> iso9660 support itself. Besides adding a new Config.in entry, a little
> bit of .mk code and the isolinux.cfg default configuration, not much
> is needed.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

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

Yet, see a little comment below...

[--SNIP--]
> diff --git a/fs/iso9660/iso9660.mk b/fs/iso9660/iso9660.mk
> index 6a1b214..588e07b 100644
> --- a/fs/iso9660/iso9660.mk
> +++ b/fs/iso9660/iso9660.mk
> @@ -53,6 +53,17 @@ define ROOTFS_ISO9660_INSTALL_BOOTLOADER
>  	$(INSTALL) -D -m 0644 $(GRUB_DIR)/stage2/stage2_eltorito \
>  		$(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/stage2_eltorito
>  endef
> +else ifeq ($(BR2_TARGET_ROOTFS_ISO9660_ISOLINUX),y)
> +ROOTFS_ISO9660_DEPENDENCIES += syslinux
> +ROOTFS_ISO9660_BOOTLOADER_CONFIG_PATH = \
> +	$(ROOTFS_ISO9660_TARGET_DIR)/isolinux/isolinux.cfg
> +ROOTFS_ISO9660_BOOT_IMAGE = isolinux/isolinux.bin
> +define ROOTFS_ISO9660_INSTALL_BOOTLOADER
> +	$(INSTALL) -D -m 0644 $(BINARIES_DIR)/syslinux/isolinux.bin \
> +		$(ROOTFS_ISO9660_TARGET_DIR)/isolinux/isolinux.bin
> +	$(INSTALL) -D -m 0644 $(HOST_DIR)/usr/share/syslinux/ldlinux.c32 \
> +		$(ROOTFS_ISO9660_TARGET_DIR)/isolinux/ldlinux.c32

In my previous review, I suggested we always install ldlinux.c32 from
the syslinux package, and into $(BINARIES_DIR)/syslinux, to which you
seemed to agree.

However, it looks like you overlooked that part. ;-)

Still, this patch is good as-is, and can be refined with further
patching later on, hence my reviewed-by tag.

Thanks! :-)

Regards,
Yann E. MORIN.

> +endef
>  endif
>  
>  define ROOTFS_ISO9660_PREPARATION
> diff --git a/fs/iso9660/isolinux.cfg b/fs/iso9660/isolinux.cfg
> new file mode 100644
> index 0000000..28be4fa
> --- /dev/null
> +++ b/fs/iso9660/isolinux.cfg
> @@ -0,0 +1,5 @@
> +default 1
> +label 1
> +      kernel __KERNEL_PATH__
> +      initrd __INITRD_PATH__
> +      append root=/dev/sr0
> -- 
> 2.1.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] 32+ messages in thread

* [Buildroot] [PATCHv2 13/15] fs/iso9660: add hybrid image support
  2015-06-08 22:21 ` [Buildroot] [PATCHv2 13/15] fs/iso9660: add hybrid image support Thomas Petazzoni
@ 2015-06-14 15:49   ` Yann E. MORIN
  2015-06-14 15:49   ` Yann E. MORIN
  2015-07-27  9:24   ` Noé RUBINSTEIN
  2 siblings, 0 replies; 32+ messages in thread
From: Yann E. MORIN @ 2015-06-14 15:49 UTC (permalink / raw)
  To: buildroot

Thomas, All,

On 2015-06-09 00:21 +0200, Thomas Petazzoni spake thusly:
> This commit adds a new option, which allows, when isolinux is used as
> the bootloader, to generate an "hybrid" ISO image. Such images can
> either be booted from CD-ROM or from USB keys. It simply uses the
> isohybrid tool provided by syslinux.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

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

Regards,
Yann E. MORIN.

> ---
>  fs/iso9660/Config.in  | 9 +++++++++
>  fs/iso9660/iso9660.mk | 8 ++++++++
>  2 files changed, 17 insertions(+)
> 
> diff --git a/fs/iso9660/Config.in b/fs/iso9660/Config.in
> index 97925b9..6f057ea 100644
> --- a/fs/iso9660/Config.in
> +++ b/fs/iso9660/Config.in
> @@ -58,6 +58,15 @@ config BR2_TARGET_ROOTFS_ISO9660_INITRD
>  	  contain a kernel image, an initrd image (unless an initramfs
>  	  linked into the kernel is used) and the bootloader.
>  
> +config BR2_TARGET_ROOTFS_ISO9660_HYBRID
> +	bool "Build hybrid image"
> +	depends on BR2_TARGET_ROOTFS_ISO9660_ISOLINUX
> +	help
> +	  Enable this option to build an hybrid image, i.e an image
> +	  which can either be booted from a CD-ROM or from a device
> +	  which BIOS considers a hard disk or ZIP disk, e.g. a USB key
> +	  or similar.
> +
>  endif
>  
>  comment "iso image needs a Linux kernel and one of grub or isolinux to be built"
> diff --git a/fs/iso9660/iso9660.mk b/fs/iso9660/iso9660.mk
> index 588e07b..4f4abea 100644
> --- a/fs/iso9660/iso9660.mk
> +++ b/fs/iso9660/iso9660.mk
> @@ -140,4 +140,12 @@ define ROOTFS_ISO9660_CMD
>  		-o $@ $(ROOTFS_ISO9660_TARGET_DIR)
>  endef
>  
> +ifeq ($(BR2_TARGET_ROOTFS_ISO9660_HYBRID),y)
> +define ROOTFS_ISO9660_GEN_HYBRID
> +	$(HOST_DIR)/usr/bin/isohybrid -t 0x96 $@
> +endef
> +
> +ROOTFS_ISO9660_POST_GEN_HOOKS += ROOTFS_ISO9660_GEN_HYBRID
> +endif
> +
>  $(eval $(call ROOTFS_TARGET,iso9660))
> -- 
> 2.1.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] 32+ messages in thread

* [Buildroot] [PATCHv2 13/15] fs/iso9660: add hybrid image support
  2015-06-08 22:21 ` [Buildroot] [PATCHv2 13/15] fs/iso9660: add hybrid image support Thomas Petazzoni
  2015-06-14 15:49   ` Yann E. MORIN
@ 2015-06-14 15:49   ` Yann E. MORIN
  2015-07-27  9:24   ` Noé RUBINSTEIN
  2 siblings, 0 replies; 32+ messages in thread
From: Yann E. MORIN @ 2015-06-14 15:49 UTC (permalink / raw)
  To: buildroot

Thomas, All,

On 2015-06-09 00:21 +0200, Thomas Petazzoni spake thusly:
> This commit adds a new option, which allows, when isolinux is used as
> the bootloader, to generate an "hybrid" ISO image. Such images can
> either be booted from CD-ROM or from USB keys. It simply uses the
> isohybrid tool provided by syslinux.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

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

Regards,
Yann E. MORIN.

> ---
>  fs/iso9660/Config.in  | 9 +++++++++
>  fs/iso9660/iso9660.mk | 8 ++++++++
>  2 files changed, 17 insertions(+)
> 
> diff --git a/fs/iso9660/Config.in b/fs/iso9660/Config.in
> index 97925b9..6f057ea 100644
> --- a/fs/iso9660/Config.in
> +++ b/fs/iso9660/Config.in
> @@ -58,6 +58,15 @@ config BR2_TARGET_ROOTFS_ISO9660_INITRD
>  	  contain a kernel image, an initrd image (unless an initramfs
>  	  linked into the kernel is used) and the bootloader.
>  
> +config BR2_TARGET_ROOTFS_ISO9660_HYBRID
> +	bool "Build hybrid image"
> +	depends on BR2_TARGET_ROOTFS_ISO9660_ISOLINUX
> +	help
> +	  Enable this option to build an hybrid image, i.e an image
> +	  which can either be booted from a CD-ROM or from a device
> +	  which BIOS considers a hard disk or ZIP disk, e.g. a USB key
> +	  or similar.
> +
>  endif
>  
>  comment "iso image needs a Linux kernel and one of grub or isolinux to be built"
> diff --git a/fs/iso9660/iso9660.mk b/fs/iso9660/iso9660.mk
> index 588e07b..4f4abea 100644
> --- a/fs/iso9660/iso9660.mk
> +++ b/fs/iso9660/iso9660.mk
> @@ -140,4 +140,12 @@ define ROOTFS_ISO9660_CMD
>  		-o $@ $(ROOTFS_ISO9660_TARGET_DIR)
>  endef
>  
> +ifeq ($(BR2_TARGET_ROOTFS_ISO9660_HYBRID),y)
> +define ROOTFS_ISO9660_GEN_HYBRID
> +	$(HOST_DIR)/usr/bin/isohybrid -t 0x96 $@
> +endef
> +
> +ROOTFS_ISO9660_POST_GEN_HOOKS += ROOTFS_ISO9660_GEN_HYBRID
> +endif
> +
>  $(eval $(call ROOTFS_TARGET,iso9660))
> -- 
> 2.1.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] 32+ messages in thread

* [Buildroot] [PATCHv2 14/15] grub2: prepare and install El Torito image
  2015-06-08 22:21 ` [Buildroot] [PATCHv2 14/15] grub2: prepare and install El Torito image Thomas Petazzoni
@ 2015-06-14 15:50   ` Yann E. MORIN
  0 siblings, 0 replies; 32+ messages in thread
From: Yann E. MORIN @ 2015-06-14 15:50 UTC (permalink / raw)
  To: buildroot

Thomas, All,

On 2015-06-09 00:21 +0200, Thomas Petazzoni spake thusly:
> In order to support ISO9660 bootable images that rely on Grub 2, this
> commit modifies thr Grub 2 makefile to generate and install an El
> Torito image. Such an image is simply produced by concatenating the
> cdboot.img provided by Grub 2, and the Grub 2 image generated by
> Buildroot using grub-mkimage.
> 
> Since this action is so simple and cost-free, we don't bother adding a
> Grub 2 sub-option for that, and simply generate the El Torito image
> unconditionally.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

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

Regards,
Yann E. MORIN.

> ---
>  boot/grub2/grub2.mk | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/boot/grub2/grub2.mk b/boot/grub2/grub2.mk
> index 697f0ad..280b4d6 100644
> --- a/boot/grub2/grub2.mk
> +++ b/boot/grub2/grub2.mk
> @@ -76,6 +76,8 @@ define GRUB2_IMAGE_INSTALLATION
>  		-p "$(GRUB2_PREFIX)" \
>  		$(if $(GRUB2_BUILTIN_CONFIG),-c $(GRUB2_BUILTIN_CONFIG)) \
>  		$(GRUB2_BUILTIN_MODULES)
> +	cat $(HOST_DIR)/usr/lib/grub/$(GRUB2_TUPLE)/cdboot.img $(GRUB2_IMAGE) > \
> +		$(BINARIES_DIR)/grub-eltorito.img
>  	mkdir -p $(dir $(GRUB2_CFG))
>  	$(INSTALL) -D -m 0644 boot/grub2/grub.cfg $(GRUB2_CFG)
>  endef
> -- 
> 2.1.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] 32+ messages in thread

* [Buildroot] [PATCHv2 15/15] fs/iso9660: add support for grub2
  2015-06-08 22:21 ` [Buildroot] [PATCHv2 15/15] fs/iso9660: add support for grub2 Thomas Petazzoni
@ 2015-06-14 15:56   ` Yann E. MORIN
  2015-06-14 21:26     ` Thomas Petazzoni
  0 siblings, 1 reply; 32+ messages in thread
From: Yann E. MORIN @ 2015-06-14 15:56 UTC (permalink / raw)
  To: buildroot

Thomas, All,

On 2015-06-09 00:21 +0200, Thomas Petazzoni spake thusly:
> After having extended the iso9660 support to allow isolinux as an
> alternative to grub, this commit adds grub2 as a third
> alternative. With the previous work done to support isolinux, adding
> support for grub2 is fairly trivial.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

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

Yet, see a small comment, below...

[--SNIP--]
> diff --git a/fs/iso9660/grub.cfg b/fs/iso9660/grub.cfg
> new file mode 100644
> index 0000000..90e1039
> --- /dev/null
> +++ b/fs/iso9660/grub.cfg
> @@ -0,0 +1,7 @@
> +set default="0"
> +set timeout="5"

For grub, the timeout is 10s. I don't mind which value we use, I don't
even really mind they differ, but do we maybe want some consistency? ;-)

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  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] 32+ messages in thread

* [Buildroot] [PATCHv2 08/15] fs/iso9660: support building a real iso9660 filesystem
  2015-06-14 15:17   ` Yann E. MORIN
@ 2015-06-14 21:20     ` Thomas Petazzoni
  0 siblings, 0 replies; 32+ messages in thread
From: Thomas Petazzoni @ 2015-06-14 21:20 UTC (permalink / raw)
  To: buildroot

Dear Yann E. MORIN,

On Sun, 14 Jun 2015 17:17:40 +0200, Yann E. MORIN wrote:

> I have to admit I was not very confortable reviewing this patch, because
> the splashscreen settign are split in two locations, and checking all
> possible code paths (not that many, but still) to ensure splashscreen
> was either properly copied or disabled, was not trivial.

Yes, the splashscreen handling is split because:

 * We want to remove the splashscreen related line in menu.lst if Grub
   hasn't been built with splashscreen support, and this in both
   iso9660 as the real root filesystem *and* iso9660 using
   initrd/initramfs.

 * We want to copy the splashscreen image to the temporary target dir
   only if we're doing iso9660 using initrd/initramfs (not needed if
   iso9660 is the real root filesystem, since the splashscreen has
   already been installed by grub.mk).

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCHv2 12/15] fs/iso9660: add isolinux support
  2015-06-14 15:47   ` Yann E. MORIN
@ 2015-06-14 21:24     ` Thomas Petazzoni
  0 siblings, 0 replies; 32+ messages in thread
From: Thomas Petazzoni @ 2015-06-14 21:24 UTC (permalink / raw)
  To: buildroot

Dear Yann E. MORIN,

On Sun, 14 Jun 2015 17:47:54 +0200, Yann E. MORIN wrote:

> > +else ifeq ($(BR2_TARGET_ROOTFS_ISO9660_ISOLINUX),y)
> > +ROOTFS_ISO9660_DEPENDENCIES += syslinux
> > +ROOTFS_ISO9660_BOOTLOADER_CONFIG_PATH = \
> > +	$(ROOTFS_ISO9660_TARGET_DIR)/isolinux/isolinux.cfg
> > +ROOTFS_ISO9660_BOOT_IMAGE = isolinux/isolinux.bin
> > +define ROOTFS_ISO9660_INSTALL_BOOTLOADER
> > +	$(INSTALL) -D -m 0644 $(BINARIES_DIR)/syslinux/isolinux.bin \
> > +		$(ROOTFS_ISO9660_TARGET_DIR)/isolinux/isolinux.bin
> > +	$(INSTALL) -D -m 0644 $(HOST_DIR)/usr/share/syslinux/ldlinux.c32 \
> > +		$(ROOTFS_ISO9660_TARGET_DIR)/isolinux/ldlinux.c32
> 
> In my previous review, I suggested we always install ldlinux.c32 from
> the syslinux package, and into $(BINARIES_DIR)/syslinux, to which you
> seemed to agree.
> 
> However, it looks like you overlooked that part. ;-)

Na, na, I did not overlooked it at all! If you look at my previous
version, it was taking ldlinux.c32 directly from the syslinux build
directory $(SYSLINUX_DIR). And your concern was that the organization
of the syslinux source tree can change.

And I've discovered that in fact all the .c32 modules get installed by
the syslinux package in $(HOST_DIR)/usr/share/syslinux/.

So it was not necessary to install ldlinux.c32 to $(BINARIES_DIR):
taking it from $(HOST_DIR)/usr/share/syslinux/ was solving your
concern.

I was not really happy with installing ldlinux.c32 to $(BINARIES_DIR),
because it would make it a special case compared to the syslinux
Config.in option we already have to install modules to the target
filesystem.

So, I considered that taking ldlinux.c32 from
$(HOST_DIR)/usr/share/syslinux/ was a good enough solution.

Thanks for the review!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCHv2 15/15] fs/iso9660: add support for grub2
  2015-06-14 15:56   ` Yann E. MORIN
@ 2015-06-14 21:26     ` Thomas Petazzoni
  0 siblings, 0 replies; 32+ messages in thread
From: Thomas Petazzoni @ 2015-06-14 21:26 UTC (permalink / raw)
  To: buildroot

Dear Yann E. MORIN,

On Sun, 14 Jun 2015 17:56:43 +0200, Yann E. MORIN wrote:

> > @@ -0,0 +1,7 @@
> > +set default="0"
> > +set timeout="5"
> 
> For grub, the timeout is 10s. I don't mind which value we use, I don't
> even really mind they differ, but do we maybe want some consistency? ;-)

I've switched to a 10 seconds timeout before committing.

Thanks for the review!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCHv2 13/15] fs/iso9660: add hybrid image support
  2015-06-08 22:21 ` [Buildroot] [PATCHv2 13/15] fs/iso9660: add hybrid image support Thomas Petazzoni
  2015-06-14 15:49   ` Yann E. MORIN
  2015-06-14 15:49   ` Yann E. MORIN
@ 2015-07-27  9:24   ` Noé RUBINSTEIN
  2015-07-27  9:42     ` Thomas Petazzoni
  2 siblings, 1 reply; 32+ messages in thread
From: Noé RUBINSTEIN @ 2015-07-27  9:24 UTC (permalink / raw)
  To: buildroot

Dear Thomas,

Sorry for the late answer.

2015-06-09 0:21 GMT+02:00 Thomas Petazzoni
<thomas.petazzoni@free-electrons.com>:
> +ifeq ($(BR2_TARGET_ROOTFS_ISO9660_HYBRID),y)
> +define ROOTFS_ISO9660_GEN_HYBRID
> +       $(HOST_DIR)/usr/bin/isohybrid -t 0x96 $@
> +endef
> +
> +ROOTFS_ISO9660_POST_GEN_HOOKS += ROOTFS_ISO9660_GEN_HYBRID

My understanding is that _POST_GEN_HOOKS has been skipped in the v2
patch series, so this does not work. Is that correct?

Regards,
No? Rubinstein.

-- 




*This email and any attachment thereto are confidential and intended solely 
for the use of the individual or entity to whom they are addressed.If you 
are not the intended recipient, please be advised that disclosing, copying, 
distributing or taking any action in reliance on the contents of this email 
is strictly prohibited. In such case, please immediately advise the sender, 
and delete all copies and attachment from your system.This email shall not 
be construed and is not tantamount to an offer, an acceptance of offer, or 
an agreement by Aldebaran Robotics on any discussion or contractual 
document whatsoever. No employee or agent is authorized to represent or 
bind Aldebaran Robotics to third parties by email, or act on behalf of 
Aldebaran Robotics by email, without express written confirmation by 
Aldebaran Robotics? duly authorized representatives.*
------------------------------

*Ce message ?lectronique et ?ventuelles pi?ces jointes sont confidentiels, 
et exclusivement destin?s ? la personne ou l'entit? ? qui ils sont 
adress?s.*

*Si vous n'?tes pas le destinataire vis?, vous ?tes pri? de ne pas 
divulguer, copier, distribuer ou prendre toute d?cision sur la foi de ce 
message ?lectronique. Merci d'en aviser imm?diatement l'exp?diteur et de 
supprimer toutes les copies et ?ventuelles pi?ces jointes de votre syst?me.*

*Ce message ?lectronique n'?quivaut pas ? une offre, ? une acceptation 
d?offre, ou ? un accord d'Aldebaran Robotics sur toute discussion ou 
document contractuel quel qu?il soit, et ne peut ?tre interpr?t? comme tel. 
Aucun employ? ou agent d?Aldebaran Robotics n'est autoris? ? repr?senter ou 
? engager la soci?t? par email, ou ? agir au nom et pour le compte de la 
soci?t? par email, sans qu?une confirmation ?crite soit donn?e par le 
repr?sentant l?gal d?Aldebaran Robotics ou par toute autre personne ayant 
re?u d?l?gation de pouvoir appropri?e.*

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

* [Buildroot] [PATCHv2 13/15] fs/iso9660: add hybrid image support
  2015-07-27  9:24   ` Noé RUBINSTEIN
@ 2015-07-27  9:42     ` Thomas Petazzoni
  0 siblings, 0 replies; 32+ messages in thread
From: Thomas Petazzoni @ 2015-07-27  9:42 UTC (permalink / raw)
  To: buildroot

No?,

On Mon, 27 Jul 2015 11:24:16 +0200, No? RUBINSTEIN wrote:

> 2015-06-09 0:21 GMT+02:00 Thomas Petazzoni
> <thomas.petazzoni@free-electrons.com>:
> > +ifeq ($(BR2_TARGET_ROOTFS_ISO9660_HYBRID),y)
> > +define ROOTFS_ISO9660_GEN_HYBRID
> > +       $(HOST_DIR)/usr/bin/isohybrid -t 0x96 $@
> > +endef
> > +
> > +ROOTFS_ISO9660_POST_GEN_HOOKS += ROOTFS_ISO9660_GEN_HYBRID
> 
> My understanding is that _POST_GEN_HOOKS has been skipped in the v2
> patch series, so this does not work. Is that correct?

Oops, you are absolutely right. I guess we simply need to do something
like:

ifeq ($(BR2_TARGET_ROOTFS_ISO9660_HYBRID),y)
define ROOTFS_ISO9660_GEN_HYBRID
        $(HOST_DIR)/usr/bin/isohybrid -t 0x96 $@
endef
endif

define ROOTFS_ISO9660_CMD
        $(HOST_DIR)/usr/bin/genisoimage -J -R -b $(ROOTFS_ISO9660_BOOT_IMAGE) \
                -no-emul-boot -boot-load-size 4 -boot-info-table \
                -o $@ $(ROOTFS_ISO9660_TARGET_DIR)
	$(ROOTFS_ISO9660_GEN_HYBRID)
endef

Can you try this, and if it works, send the corresponding patch?

Thanks a lot!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

end of thread, other threads:[~2015-07-27  9:42 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-08 22:21 [Buildroot] [PATCHv2 00/15] iso9660 support improvements Thomas Petazzoni
2015-06-08 22:21 ` [Buildroot] [PATCHv2 01/15] fs/iso9660: use if ... endif block instead of depends on Thomas Petazzoni
2015-06-08 22:21 ` [Buildroot] [PATCHv2 02/15] fs/iso9660: convert to the filesystem infrastructure Thomas Petazzoni
2015-06-14 14:52   ` Yann E. MORIN
2015-06-08 22:21 ` [Buildroot] [PATCHv2 03/15] fs/iso9660: enable Joliet extension Thomas Petazzoni
2015-06-08 22:21 ` [Buildroot] [PATCHv2 04/15] fs/iso9660: rename all variables to use the ROOTFS_ISO9660 prefix Thomas Petazzoni
2015-06-08 22:21 ` [Buildroot] [PATCHv2 05/15] fs/iso9660: change the location of the splash image Thomas Petazzoni
2015-06-08 22:21 ` [Buildroot] [PATCHv2 06/15] fs/iso9660: get grub splash from $(TARGET_DIR) Thomas Petazzoni
2015-06-14 14:59   ` Yann E. MORIN
2015-06-08 22:21 ` [Buildroot] [PATCHv2 07/15] fs/iso9660: prepare cleaner kernel/initrd path handling Thomas Petazzoni
2015-06-08 22:21 ` [Buildroot] [PATCHv2 08/15] fs/iso9660: support building a real iso9660 filesystem Thomas Petazzoni
2015-06-14 15:17   ` Yann E. MORIN
2015-06-14 21:20     ` Thomas Petazzoni
2015-06-08 22:21 ` [Buildroot] [PATCHv2 09/15] fs/iso9660: introduce new variables Thomas Petazzoni
2015-06-14 15:25   ` Yann E. MORIN
2015-06-08 22:21 ` [Buildroot] [PATCHv2 10/15] fs/iso9660: introduce bootloader choice Thomas Petazzoni
2015-06-14 15:39   ` Yann E. MORIN
2015-06-08 22:21 ` [Buildroot] [PATCHv2 11/15] fs/iso9660: use 'depends on' instead of 'select' for bootloader Thomas Petazzoni
2015-06-14 15:40   ` Yann E. MORIN
2015-06-08 22:21 ` [Buildroot] [PATCHv2 12/15] fs/iso9660: add isolinux support Thomas Petazzoni
2015-06-14 15:47   ` Yann E. MORIN
2015-06-14 21:24     ` Thomas Petazzoni
2015-06-08 22:21 ` [Buildroot] [PATCHv2 13/15] fs/iso9660: add hybrid image support Thomas Petazzoni
2015-06-14 15:49   ` Yann E. MORIN
2015-06-14 15:49   ` Yann E. MORIN
2015-07-27  9:24   ` Noé RUBINSTEIN
2015-07-27  9:42     ` Thomas Petazzoni
2015-06-08 22:21 ` [Buildroot] [PATCHv2 14/15] grub2: prepare and install El Torito image Thomas Petazzoni
2015-06-14 15:50   ` Yann E. MORIN
2015-06-08 22:21 ` [Buildroot] [PATCHv2 15/15] fs/iso9660: add support for grub2 Thomas Petazzoni
2015-06-14 15:56   ` Yann E. MORIN
2015-06-14 21:26     ` Thomas Petazzoni

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