iso9660 support improvements
v2 cover iso9660 support improvements
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
Signature · 1 line
2.1.0
PATCH v2 1/15 fs/iso9660: use if ... endif block instead of depends on
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.
--- fs/iso9660/Config.in | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
fs/iso9660/Config.in +4 -1
@@ -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
Signature · 1 line
2.1.0
PATCH v2 2/15 fs/iso9660: convert to the filesystem infrastructure
In reply to Thomas PetazzoniThis 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.
--- fs/iso9660/iso9660.mk | 68 +++++++++++++++++++++++---------------------------- 1 file changed, 31 insertions(+), 37 deletions(-)
fs/iso9660/iso9660.mk +31 -37
@@ -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))
Signature · 1 line
2.1.0
PATCH v2 2/15 fs/iso9660: convert to the filesystem infrastructure
Thomas, All,
On 2015-06-09 00:21 +0200, Thomas Petazzoni spake thusly:
Quoted 10 lines
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.
Quoted 4 lines
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 <[email protected]>
Regards,
Yann E. MORIN.
Quoted 106 lines
--- fs/iso9660/iso9660.mk | 68 +++++++++++++++++++++++---------------------------- 1 file changed, 31 insertions(+), 37 deletions(-)fs/iso9660/iso9660.mk +31
-37@@ -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))Signature · 6 lines
2.1.0 _______________________________________________ buildroot mailing list buildroot at busybox.net http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH v2 3/15 fs/iso9660: enable Joliet extension
In reply to Thomas PetazzoniWe 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.
--- fs/iso9660/iso9660.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/iso9660/iso9660.mk +1 -1
@@ -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
Signature · 1 line
2.1.0
PATCH v2 4/15 fs/iso9660: rename all variables to use the ROOTFS_ISO9660 prefix
In reply to Thomas PetazzoniFor 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 '='.
--- fs/iso9660/iso9660.mk | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-)
fs/iso9660/iso9660.mk +13 -13
@@ -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))
Signature · 1 line
2.1.0
PATCH v2 5/15 fs/iso9660: change the location of the splash image
In reply to Thomas PetazzoniIn 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.
--- fs/iso9660/iso9660.mk | 2 +- fs/iso9660/menu.lst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
fs/iso9660/iso9660.mk +1 -1
@@ -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
fs/iso9660/menu.lst +1 -1
@@ -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
Signature · 1 line
2.1.0
PATCH v2 6/15 fs/iso9660: get grub splash from $(TARGET_DIR)
In reply to Thomas PetazzoniInstead 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.
--- fs/iso9660/iso9660.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/iso9660/iso9660.mk +1 -1
@@ -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
Signature · 1 line
2.1.0
PATCH v2 6/15 fs/iso9660: get grub splash from $(TARGET_DIR)
Thomas, All,
On 2015-06-09 00:21 +0200, Thomas Petazzoni spake thusly:
Quoted 10 lines
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" <[email protected]>Signed-off-by Thomas Petazzoni <[email protected]>
Regards,
Yann E. MORIN.
Quoted 24 lines
--- fs/iso9660/iso9660.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/iso9660/iso9660.mk +1
-1@@ -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 elseSignature · 6 lines
2.1.0 _______________________________________________ buildroot mailing list buildroot at busybox.net http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH v2 7/15 fs/iso9660: prepare cleaner kernel/initrd path handling
In reply to Thomas PetazzoniThe 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).
--- fs/iso9660/Config.in | 5 +++++ fs/iso9660/iso9660.mk | 11 ++++++++--- fs/iso9660/menu.lst | 4 ++-- 3 files changed, 15 insertions(+), 5 deletions(-)
fs/iso9660/Config.in +5 -0
@@ -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
fs/iso9660/iso9660.mk +8 -3
@@ -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
fs/iso9660/menu.lst +2 -2
@@ -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)
Signature · 1 line
2.1.0
PATCH v2 8/15 fs/iso9660: support building a real iso9660 filesystem
In reply to Thomas PetazzoniUntil 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.
--- fs/iso9660/Config.in | 27 ++++++++++++- fs/iso9660/iso9660.mk | 109 ++++++++++++++++++++++++++++++++++++++------------ fs/iso9660/menu.lst | 2 +- 3 files changed, 110 insertions(+), 28 deletions(-)
fs/iso9660/Config.in +25 -2
@@ -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"
fs/iso9660/iso9660.mk +84 -25
135 lines not on this page · raw message
fs/iso9660/menu.lst +1 -1
@@ -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)
Signature · 1 line
2.1.0
PATCH v2 8/15 fs/iso9660: support building a real iso9660 filesystem
Thomas, All,
On 2015-06-09 00:21 +0200, Thomas Petazzoni spake thusly:
Quoted 32 lines
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_INITRAMFSandBR2_TARGET_ROOTFS_ISO9660_INITRDdisabled. 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_INITRDdoesn'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_INITRAMFSdisabled. In this case, a separate initrd is used. The iso9660 filesystem only contains the bootloader, the kernel and the initrd.
Quoted 6 lines
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 <[email protected]>
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:
Regards,
Yann E. MORIN.
Quoted 214 lines
--- fs/iso9660/Config.in | 27 ++++++++++++- fs/iso9660/iso9660.mk | 109 ++++++++++++++++++++++++++++++++++++++------------ fs/iso9660/menu.lst | 2 +- 3 files changed, 110 insertions(+), 28 deletions(-)fs/iso9660/Config.in +25
-2@@ -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"fs/iso9660/iso9660.mk +84
-25@@ -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 \fs/iso9660/menu.lst +1
-1@@ -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)Signature · 6 lines
2.1.0 _______________________________________________ buildroot mailing list buildroot at busybox.net http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH v2 8/15 fs/iso9660: support building a real iso9660 filesystem
Dear Yann E. MORIN,
Quoted 4 lines · Yann E. MORIN
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
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v2 9/15 fs/iso9660: introduce new variables
In reply to Thomas PetazzoniIn 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.
--- fs/iso9660/iso9660.mk | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)
fs/iso9660/iso9660.mk +10 -6
@@ -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
Signature · 1 line
2.1.0
PATCH v2 9/15 fs/iso9660: introduce new variables
Thomas, All,
On 2015-06-09 00:21 +0200, Thomas Petazzoni spake thusly:
Quoted 6 lines
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
Quoted 7 lines
-
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 <[email protected]>
Regards,
Yann E. MORIN.
Quoted 69 lines
--- fs/iso9660/iso9660.mk | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)fs/iso9660/iso9660.mk +10
-6@@ -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) endefSignature · 6 lines
2.1.0 _______________________________________________ buildroot mailing list buildroot at busybox.net http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH v2 10/15 fs/iso9660: introduce bootloader choice
In reply to Thomas PetazzoniIn 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.
--- fs/iso9660/Config.in | 14 +++++++++++--- fs/iso9660/iso9660.mk | 20 +++++++++++++++----- 2 files changed, 26 insertions(+), 8 deletions(-)
fs/iso9660/Config.in +11 -3
@@ -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
fs/iso9660/iso9660.mk +15 -5
@@ -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
Signature · 1 line
2.1.0
PATCH v2 10/15 fs/iso9660: introduce bootloader choice
Thomas, All,
On 2015-06-09 00:21 +0200, Thomas Petazzoni spake thusly:
Quoted 9 lines
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 <[email protected]>
Regards,
Yann E. MORIN.
Quoted 117 lines
--- fs/iso9660/Config.in | 14 +++++++++++--- fs/iso9660/iso9660.mk | 20 +++++++++++++++----- 2 files changed, 26 insertions(+), 8 deletions(-)fs/iso9660/Config.in +11
-3@@ -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__ willfs/iso9660/iso9660.mk +15
-5@@ -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_KERNELSignature · 6 lines
2.1.0 _______________________________________________ buildroot mailing list buildroot at busybox.net http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH v2 11/15 fs/iso9660: use 'depends on' instead of 'select' for bootloader
In reply to Thomas PetazzoniIn 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".
--- fs/iso9660/Config.in | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
fs/iso9660/Config.in +4 -3
@@ -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
Signature · 1 line
2.1.0
PATCH v2 11/15 fs/iso9660: use 'depends on' instead of 'select' for bootloader
Thomas, All,
On 2015-06-09 00:21 +0200, Thomas Petazzoni spake thusly:
Quoted 9 lines
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 <[email protected]>
Regards,
Yann E. MORIN.
Quoted 41 lines
--- fs/iso9660/Config.in | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)fs/iso9660/Config.in +4
-3@@ -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_GRUBSignature · 6 lines
2.1.0 _______________________________________________ buildroot mailing list buildroot at busybox.net http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH v2 12/15 fs/iso9660: add isolinux support
In reply to Thomas PetazzoniAfter 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.
--- 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
fs/iso9660/Config.in +14 -6
@@ -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)
fs/iso9660/iso9660.mk +11 -0
@@ -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
fs/iso9660/isolinux.cfg new file +5 -0
@@ -0,0 +1,5 @@ +default 1 +label 1 + kernel __KERNEL_PATH__ + initrd __INITRD_PATH__ + append root=/dev/sr0
Signature · 1 line
2.1.0
PATCH v2 12/15 fs/iso9660: add isolinux support
Thomas, All,
On 2015-06-09 00:21 +0200, Thomas Petazzoni spake thusly:
Quoted 6 lines
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 <[email protected]>
Yet, see a little comment below...
[--SNIP--]
Quoted 8 lines
fs/iso9660/iso9660.mk +0
-0@@ -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
fs/iso9660/iso9660.mk define ROOTFS_ISO9660_INSTALL_BOOTLOADER · line 65
Quoted 10 lines
fs/iso9660/iso9660.mk +10
-0+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.
Quoted 22 lines
fs/iso9660/iso9660.mk +1
-0+endef endif define ROOTFS_ISO9660_PREPARATIONfs/iso9660/isolinux.cfg new file +5
-0@@ -0,0 +1,5 @@ +default 1 +label 1 + kernel __KERNEL_PATH__ + initrd __INITRD_PATH__ + append root=/dev/sr0Signature · 6 lines
2.1.0 _______________________________________________ buildroot mailing list buildroot at busybox.net http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH v2 12/15 fs/iso9660: add isolinux support
Dear Yann E. MORIN,
Quoted 15 lines · Yann E. MORIN
fs/iso9660/iso9660.mk define ROOTFS_ISO9660_INSTALL_BOOTLOADER · line 65
Quoted 10 lines
fs/iso9660/iso9660.mk +10
-0+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.c32In 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.
Quoted 1 line
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
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v2 13/15 fs/iso9660: add hybrid image support
In reply to Thomas PetazzoniThis 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.
--- fs/iso9660/Config.in | 9 +++++++++ fs/iso9660/iso9660.mk | 8 ++++++++ 2 files changed, 17 insertions(+)
fs/iso9660/Config.in +9 -0
@@ -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"
fs/iso9660/iso9660.mk +8 -0
@@ -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))
Signature · 1 line
2.1.0
PATCH v2 13/15 fs/iso9660: add hybrid image support
Thomas, All,
On 2015-06-09 00:21 +0200, Thomas Petazzoni spake thusly:
Quoted 6 lines
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 <[email protected]>
Regards,
Yann E. MORIN.
Quoted 49 lines
--- fs/iso9660/Config.in | 9 +++++++++ fs/iso9660/iso9660.mk | 8 ++++++++ 2 files changed, 17 insertions(+)fs/iso9660/Config.in +9
-0@@ -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"fs/iso9660/iso9660.mk +8
-0@@ -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))Signature · 6 lines
2.1.0 _______________________________________________ buildroot mailing list buildroot at busybox.net http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH v2 13/15 fs/iso9660: add hybrid image support
In reply to Thomas PetazzoniThomas, All,
On 2015-06-09 00:21 +0200, Thomas Petazzoni spake thusly:
Quoted 6 lines
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 <[email protected]>
Regards,
Yann E. MORIN.
Quoted 49 lines
--- fs/iso9660/Config.in | 9 +++++++++ fs/iso9660/iso9660.mk | 8 ++++++++ 2 files changed, 17 insertions(+)fs/iso9660/Config.in +9
-0@@ -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"fs/iso9660/iso9660.mk +8
-0@@ -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))Signature · 6 lines
2.1.0 _______________________________________________ buildroot mailing list buildroot at busybox.net http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH v2 13/15 fs/iso9660: add hybrid image support
In reply to Thomas PetazzoniDear Thomas,
Sorry for the late answer.
2015-06-09 0:21 GMT+02:00 Thomas Petazzoni
<[email protected]>:
fs/iso9660/iso9660.mk define ROOTFS_ISO9660_CMD · line 148
Quoted 6 lines
fs/iso9660/iso9660.mk +6
-0+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.
Signature · 31 lines
*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.*
PATCH v2 13/15 fs/iso9660: add hybrid image support
No?,
Quoted 11 lines · No? RUBINSTEIN
2015-06-09 0:21 GMT+02:00 Thomas Petazzoni
<[email protected]>:fs/iso9660/iso9660.mk define ROOTFS_ISO9660_CMD · line 148
Quoted 6 lines
fs/iso9660/iso9660.mk +6
-0+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_HYBRIDMy understanding is that
_POST_GEN_HOOKShas 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
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v2 14/15 grub2: prepare and install El Torito image
In reply to Thomas PetazzoniIn 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.
--- boot/grub2/grub2.mk | 2 ++ 1 file changed, 2 insertions(+)
boot/grub2/grub2.mk +2 -0
@@ -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
Signature · 1 line
2.1.0
PATCH v2 14/15 grub2: prepare and install El Torito image
Thomas, All,
On 2015-06-09 00:21 +0200, Thomas Petazzoni spake thusly:
Quoted 11 lines
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 <[email protected]>
Regards,
Yann E. MORIN.
Quoted 24 lines
--- boot/grub2/grub2.mk | 2 ++ 1 file changed, 2 insertions(+)boot/grub2/grub2.mk +2
-0@@ -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) endefSignature · 6 lines
2.1.0 _______________________________________________ buildroot mailing list buildroot at busybox.net http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH v2 15/15 fs/iso9660: add support for grub2
In reply to Thomas PetazzoniAfter 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.
--- 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
fs/iso9660/Config.in +15 -3
@@ -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)
fs/iso9660/grub.cfg new file +7 -0
@@ -0,0 +1,7 @@ +set default="0" +set timeout="5" + +menuentry "Buildroot" { + linux __KERNEL_PATH__ root=/dev/sr0 + initrd __INITRD_PATH__ +}
fs/iso9660/iso9660.mk +9 -0
@@ -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 = \
Signature · 1 line
2.1.0
PATCH v2 15/15 fs/iso9660: add support for grub2
Thomas, All,
On 2015-06-09 00:21 +0200, Thomas Petazzoni spake thusly:
Quoted 6 lines
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 <[email protected]>
Yet, see a small comment, below...
[--SNIP--]
fs/iso9660/grub.cfg line 2
Quoted 8 lines
fs/iso9660/grub.cfg new file +2
-0@@ -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.
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH v2 15/15 fs/iso9660: add support for grub2
Dear Yann E. MORIN,
Quoted 6 lines · Yann E. MORIN
fs/iso9660/grub.cfg line 2
Quoted 3 lines
fs/iso9660/grub.cfg new file +2
-0@@ -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
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com