* [Buildroot] [PATCH 01/12] fs/common: add <fs>_POST_GEN_HOOKS support
2015-06-04 15:05 [Buildroot] [PATCH 00/12] iso9660 support improvements Thomas Petazzoni
@ 2015-06-04 15:05 ` Thomas Petazzoni
2015-06-05 9:43 ` Samuel Martin
2015-06-05 20:49 ` Yann E. MORIN
2015-06-04 15:05 ` [Buildroot] [PATCH 02/12] fs/iso9660: convert to the filesystem infrastructure Thomas Petazzoni
` (10 subsequent siblings)
11 siblings, 2 replies; 55+ messages in thread
From: Thomas Petazzoni @ 2015-06-04 15:05 UTC (permalink / raw)
To: buildroot
The common filesystem infrastructure already supports a
<fs>_PRE_GEN_HOOKS variable, which allows filesystem makefiles to
register some actions to be done before the root filesystem image is
generated.
This commit adds a similiar <fs>_POST_GEN_HOOKS variable, which will
allow filesystem makefiles to do some actions after the filesystem
image has been generated. It will initially be used by the iso9660
filesystem to delete the temporary directory it creates.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
fs/common.mk | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/fs/common.mk b/fs/common.mk
index 4387d06..40389bd 100644
--- a/fs/common.mk
+++ b/fs/common.mk
@@ -16,6 +16,9 @@
# ROOTFS_$(FSTYPE)_PRE_GEN_HOOKS, a list of hooks to call before
# generating the filesystem image
#
+# ROOTFS_$(FSTYPE)_POST_GEN_HOOKS, a list of hooks to call after
+# generating the filesystem image
+#
# ROOTFS_$(FSTYPE)_POST_TARGETS, the list of targets that should be
# run after running the main filesystem target. This is useful for
# initramfs, to rebuild the kernel once the initramfs is generated.
@@ -96,6 +99,7 @@ endif
ifneq ($$(ROOTFS_$(2)_COMPRESS_CMD),)
PATH=$$(BR_PATH) $$(ROOTFS_$(2)_COMPRESS_CMD) $$@ > $$@$$(ROOTFS_$(2)_COMPRESS_EXT)
endif
+ $$(foreach hook,$$(ROOTFS_$(2)_POST_GEN_HOOKS),$$(call $$(hook))$$(sep))
rootfs-$(1)-show-depends:
@echo $$(ROOTFS_$(2)_DEPENDENCIES)
--
2.1.0
^ permalink raw reply related [flat|nested] 55+ messages in thread* [Buildroot] [PATCH 01/12] fs/common: add <fs>_POST_GEN_HOOKS support
2015-06-04 15:05 ` [Buildroot] [PATCH 01/12] fs/common: add <fs>_POST_GEN_HOOKS support Thomas Petazzoni
@ 2015-06-05 9:43 ` Samuel Martin
2015-06-05 20:49 ` Yann E. MORIN
1 sibling, 0 replies; 55+ messages in thread
From: Samuel Martin @ 2015-06-05 9:43 UTC (permalink / raw)
To: buildroot
Hi Thomas, all,
On Thu, Jun 4, 2015 at 5:05 PM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> The common filesystem infrastructure already supports a
> <fs>_PRE_GEN_HOOKS variable, which allows filesystem makefiles to
> register some actions to be done before the root filesystem image is
> generated.
>
> This commit adds a similiar <fs>_POST_GEN_HOOKS variable, which will
> allow filesystem makefiles to do some actions after the filesystem
> image has been generated. It will initially be used by the iso9660
> filesystem to delete the temporary directory it creates.
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: Samuel Martin <s.martin49@gmail.com>
Regards,
--
Samuel
^ permalink raw reply [flat|nested] 55+ messages in thread
* [Buildroot] [PATCH 01/12] fs/common: add <fs>_POST_GEN_HOOKS support
2015-06-04 15:05 ` [Buildroot] [PATCH 01/12] fs/common: add <fs>_POST_GEN_HOOKS support Thomas Petazzoni
2015-06-05 9:43 ` Samuel Martin
@ 2015-06-05 20:49 ` Yann E. MORIN
1 sibling, 0 replies; 55+ messages in thread
From: Yann E. MORIN @ 2015-06-05 20:49 UTC (permalink / raw)
To: buildroot
Thomas, All,
On 2015-06-04 17:05 +0200, Thomas Petazzoni spake thusly:
> The common filesystem infrastructure already supports a
> <fs>_PRE_GEN_HOOKS variable, which allows filesystem makefiles to
> register some actions to be done before the root filesystem image is
> generated.
>
> This commit adds a similiar <fs>_POST_GEN_HOOKS variable, which will
> allow filesystem makefiles to do some actions after the filesystem
> image has been generated. It will initially be used by the iso9660
> filesystem to delete the temporary directory it creates.
>
> 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/common.mk | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/fs/common.mk b/fs/common.mk
> index 4387d06..40389bd 100644
> --- a/fs/common.mk
> +++ b/fs/common.mk
> @@ -16,6 +16,9 @@
> # ROOTFS_$(FSTYPE)_PRE_GEN_HOOKS, a list of hooks to call before
> # generating the filesystem image
> #
> +# ROOTFS_$(FSTYPE)_POST_GEN_HOOKS, a list of hooks to call after
> +# generating the filesystem image
> +#
> # ROOTFS_$(FSTYPE)_POST_TARGETS, the list of targets that should be
> # run after running the main filesystem target. This is useful for
> # initramfs, to rebuild the kernel once the initramfs is generated.
> @@ -96,6 +99,7 @@ endif
> ifneq ($$(ROOTFS_$(2)_COMPRESS_CMD),)
> PATH=$$(BR_PATH) $$(ROOTFS_$(2)_COMPRESS_CMD) $$@ > $$@$$(ROOTFS_$(2)_COMPRESS_EXT)
> endif
> + $$(foreach hook,$$(ROOTFS_$(2)_POST_GEN_HOOKS),$$(call $$(hook))$$(sep))
>
> rootfs-$(1)-show-depends:
> @echo $$(ROOTFS_$(2)_DEPENDENCIES)
> --
> 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] 55+ messages in thread
* [Buildroot] [PATCH 02/12] fs/iso9660: convert to the filesystem infrastructure
2015-06-04 15:05 [Buildroot] [PATCH 00/12] iso9660 support improvements Thomas Petazzoni
2015-06-04 15:05 ` [Buildroot] [PATCH 01/12] fs/common: add <fs>_POST_GEN_HOOKS support Thomas Petazzoni
@ 2015-06-04 15:05 ` Thomas Petazzoni
2015-06-05 11:59 ` Samuel Martin
` (2 more replies)
2015-06-04 15:05 ` [Buildroot] [PATCH 03/12] fs/iso9660: use if ... endif block instead of depends on Thomas Petazzoni
` (9 subsequent siblings)
11 siblings, 3 replies; 55+ messages in thread
From: Thomas Petazzoni @ 2015-06-04 15:05 UTC (permalink / raw)
To: buildroot
Now that we have <fs>_POST_GEN_HOOKS, there is nothing that prevents
the iso9660 filesystem logic from using the common filesystem
infrastructure.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
fs/iso9660/iso9660.mk | 64 +++++++++++++++++++++++++--------------------------
1 file changed, 31 insertions(+), 33 deletions(-)
diff --git a/fs/iso9660/iso9660.mk b/fs/iso9660/iso9660.mk
index 4ccfce9..5a29673 100644
--- a/fs/iso9660/iso9660.mk
+++ b/fs/iso9660/iso9660.mk
@@ -2,9 +2,6 @@
#
# 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
@@ -12,49 +9,50 @@ 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),)
+define ROOTFS_ISO9660_SPLASHSCREEN
$(SED) '/^splashimage/d' $(ISO9660_TARGET_DIR)/boot/grub/menu.lst
+endef
else
+define ROOTFS_ISO9660_SPLASHSCREEN
$(INSTALL) -D -m 0644 boot/grub/splash.xpm.gz \
$(ISO9660_TARGET_DIR)/splash.xpm.gz
+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
+ $(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
+define ROOTFS_ISO9660_REMOVE_TEMPDIR
+ $(RM) -rf $(ISO9660_TARGET_DIR)
+endef
+
+ROOTFS_ISO9660_POST_GEN_HOOKS += ROOTFS_ISO9660_REMOVE_TEMPDIR
+
+$(eval $(call ROOTFS_TARGET,iso9660))
--
2.1.0
^ permalink raw reply related [flat|nested] 55+ messages in thread* [Buildroot] [PATCH 02/12] fs/iso9660: convert to the filesystem infrastructure
2015-06-04 15:05 ` [Buildroot] [PATCH 02/12] fs/iso9660: convert to the filesystem infrastructure Thomas Petazzoni
@ 2015-06-05 11:59 ` Samuel Martin
2015-06-05 13:34 ` Thomas Petazzoni
2015-06-05 20:58 ` Yann E. MORIN
2015-06-05 22:44 ` Arnout Vandecappelle
2 siblings, 1 reply; 55+ messages in thread
From: Samuel Martin @ 2015-06-05 11:59 UTC (permalink / raw)
To: buildroot
Hi Thomas,
On Thu, Jun 4, 2015 at 5:05 PM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Now that we have <fs>_POST_GEN_HOOKS, there is nothing that prevents
> the iso9660 filesystem logic from using the common filesystem
> infrastructure.
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---
> fs/iso9660/iso9660.mk | 64 +++++++++++++++++++++++++--------------------------
> 1 file changed, 31 insertions(+), 33 deletions(-)
>
> diff --git a/fs/iso9660/iso9660.mk b/fs/iso9660/iso9660.mk
> index 4ccfce9..5a29673 100644
> --- a/fs/iso9660/iso9660.mk
> +++ b/fs/iso9660/iso9660.mk
> @@ -2,9 +2,6 @@
> #
> # 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
> @@ -12,49 +9,50 @@ 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),)
> +define ROOTFS_ISO9660_SPLASHSCREEN
> $(SED) '/^splashimage/d' $(ISO9660_TARGET_DIR)/boot/grub/menu.lst
> +endef
> else
> +define ROOTFS_ISO9660_SPLASHSCREEN
> $(INSTALL) -D -m 0644 boot/grub/splash.xpm.gz \
> $(ISO9660_TARGET_DIR)/splash.xpm.gz
> +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
> + $(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)
Why the fakeroot trickery on genisoimage call is gone? or why is it
not needed anymore?
> +endef
>
> -################################################################################
> -#
> -# Toplevel Makefile options
> -#
> -################################################################################
> -ifeq ($(BR2_TARGET_ROOTFS_ISO9660),y)
> -TARGETS_ROOTFS += rootfs-iso9660
> -endif
> +define ROOTFS_ISO9660_REMOVE_TEMPDIR
> + $(RM) -rf $(ISO9660_TARGET_DIR)
> +endef
> +
> +ROOTFS_ISO9660_POST_GEN_HOOKS += ROOTFS_ISO9660_REMOVE_TEMPDIR
> +
> +$(eval $(call ROOTFS_TARGET,iso9660))
> --
> 2.1.0
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
Regards,
--
Samuel
^ permalink raw reply [flat|nested] 55+ messages in thread
* [Buildroot] [PATCH 02/12] fs/iso9660: convert to the filesystem infrastructure
2015-06-05 11:59 ` Samuel Martin
@ 2015-06-05 13:34 ` Thomas Petazzoni
0 siblings, 0 replies; 55+ messages in thread
From: Thomas Petazzoni @ 2015-06-05 13:34 UTC (permalink / raw)
To: buildroot
Dear Samuel Martin,
On Fri, 5 Jun 2015 13:59:50 +0200, Samuel Martin wrote:
> > +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)
>
> Why the fakeroot trickery on genisoimage call is gone? or why is it
> not needed anymore?
That's the whole point of moving to the common rootfs infrastructure:
all the fakeroot trickery is handled by it. Look at the ext2 or ubifs
logic, none of them call fakeroot, because it's done in common code in
fs/common.mk.
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] 55+ messages in thread
* [Buildroot] [PATCH 02/12] fs/iso9660: convert to the filesystem infrastructure
2015-06-04 15:05 ` [Buildroot] [PATCH 02/12] fs/iso9660: convert to the filesystem infrastructure Thomas Petazzoni
2015-06-05 11:59 ` Samuel Martin
@ 2015-06-05 20:58 ` Yann E. MORIN
2015-06-06 0:42 ` Thomas Petazzoni
2015-06-05 22:44 ` Arnout Vandecappelle
2 siblings, 1 reply; 55+ messages in thread
From: Yann E. MORIN @ 2015-06-05 20:58 UTC (permalink / raw)
To: buildroot
Thomas, All,
On 2015-06-04 17:05 +0200, Thomas Petazzoni spake thusly:
> Now that we have <fs>_POST_GEN_HOOKS, there is nothing that prevents
> the iso9660 filesystem logic from using the common filesystem
> infrastructure.
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
However, see a comment below...
> ---
> fs/iso9660/iso9660.mk | 64 +++++++++++++++++++++++++--------------------------
> 1 file changed, 31 insertions(+), 33 deletions(-)
>
> diff --git a/fs/iso9660/iso9660.mk b/fs/iso9660/iso9660.mk
> index 4ccfce9..5a29673 100644
> --- a/fs/iso9660/iso9660.mk
> +++ b/fs/iso9660/iso9660.mk
> @@ -2,9 +2,6 @@
> #
> # 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
> @@ -12,49 +9,50 @@ 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),)
I know this was pre-existing code, but we usually prefer positive logic.
Do you think you might arrange to fix the logic in this test with
anotehr patch? ;-)
Regards,
Yann E. MORIN.
> +define ROOTFS_ISO9660_SPLASHSCREEN
> $(SED) '/^splashimage/d' $(ISO9660_TARGET_DIR)/boot/grub/menu.lst
> +endef
> else
> +define ROOTFS_ISO9660_SPLASHSCREEN
> $(INSTALL) -D -m 0644 boot/grub/splash.xpm.gz \
> $(ISO9660_TARGET_DIR)/splash.xpm.gz
> +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
> + $(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
> +define ROOTFS_ISO9660_REMOVE_TEMPDIR
> + $(RM) -rf $(ISO9660_TARGET_DIR)
> +endef
> +
> +ROOTFS_ISO9660_POST_GEN_HOOKS += ROOTFS_ISO9660_REMOVE_TEMPDIR
> +
> +$(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] 55+ messages in thread
* [Buildroot] [PATCH 02/12] fs/iso9660: convert to the filesystem infrastructure
2015-06-05 20:58 ` Yann E. MORIN
@ 2015-06-06 0:42 ` Thomas Petazzoni
2015-06-06 9:01 ` Yann E. MORIN
0 siblings, 1 reply; 55+ messages in thread
From: Thomas Petazzoni @ 2015-06-06 0:42 UTC (permalink / raw)
To: buildroot
Dear Yann E. MORIN,
On Fri, 5 Jun 2015 22:58:41 +0200, Yann E. MORIN wrote:
> > ifeq ($(BR2_TARGET_GRUB_SPLASH),)
>
> I know this was pre-existing code, but we usually prefer positive logic.
> Do you think you might arrange to fix the logic in this test with
> anotehr patch? ;-)
Isn't that already positive logic?
"if BR2_TARGET_GRUB_SPLASH is disabled"
The other solution is:
ifneq ($(BR2_TARGET_GRUB_SPLASH),y)
which is "if not BR2_TARGET_GRUB_SPLASH is enabled"
which looks worse.
Am I missing something?
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 55+ messages in thread
* [Buildroot] [PATCH 02/12] fs/iso9660: convert to the filesystem infrastructure
2015-06-06 0:42 ` Thomas Petazzoni
@ 2015-06-06 9:01 ` Yann E. MORIN
2015-06-06 14:57 ` Thomas Petazzoni
0 siblings, 1 reply; 55+ messages in thread
From: Yann E. MORIN @ 2015-06-06 9:01 UTC (permalink / raw)
To: buildroot
Thomas, All,
On 2015-06-06 02:42 +0200, Thomas Petazzoni spake thusly:
> On Fri, 5 Jun 2015 22:58:41 +0200, Yann E. MORIN wrote:
>
> > > ifeq ($(BR2_TARGET_GRUB_SPLASH),)
> >
> > I know this was pre-existing code, but we usually prefer positive logic.
> > Do you think you might arrange to fix the logic in this test with
> > anotehr patch? ;-)
>
> Isn't that already positive logic?
>
> "if BR2_TARGET_GRUB_SPLASH is disabled"
>
> The other solution is:
>
> ifneq ($(BR2_TARGET_GRUB_SPLASH),y)
>
> which is "if not BR2_TARGET_GRUB_SPLASH is enabled"
>
> which looks worse.
>
> Am I missing something?
Well, sorry, I was not completely explicit. What I meant was:
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
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] 55+ messages in thread* [Buildroot] [PATCH 02/12] fs/iso9660: convert to the filesystem infrastructure
2015-06-06 9:01 ` Yann E. MORIN
@ 2015-06-06 14:57 ` Thomas Petazzoni
2015-06-06 16:03 ` Yann E. MORIN
0 siblings, 1 reply; 55+ messages in thread
From: Thomas Petazzoni @ 2015-06-06 14:57 UTC (permalink / raw)
To: buildroot
Dear Yann E. MORIN,
On Sat, 6 Jun 2015 11:01:48 +0200, Yann E. MORIN wrote:
> Well, sorry, I was not completely explicit. What I meant was:
>
> 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
Yes, but no.
The $(SED) '/^splashimage/d' case needs to be done in all cases if
BR2_TARGET_GRUB_SPLASH is disabled (regardless whether we're using
initrd/initramfs or a real iso9660 for the rootfs).
However, the $(INSTALL) needs to be done only if
BR2_TARGET_GRUB_SPLASH=y *and* we are using an initrd/initramfs, not if
we are using directly the rootfs in the iso9660 filesystem. So this
part only needs to be done if BR2_TARGET_GRUB_SPLASH=y *and*
ROOTFS_ISO9660_USE_INITRD=YES.
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 55+ messages in thread
* [Buildroot] [PATCH 02/12] fs/iso9660: convert to the filesystem infrastructure
2015-06-06 14:57 ` Thomas Petazzoni
@ 2015-06-06 16:03 ` Yann E. MORIN
0 siblings, 0 replies; 55+ messages in thread
From: Yann E. MORIN @ 2015-06-06 16:03 UTC (permalink / raw)
To: buildroot
Thomas, All,
On 2015-06-06 16:57 +0200, Thomas Petazzoni spake thusly:
> On Sat, 6 Jun 2015 11:01:48 +0200, Yann E. MORIN wrote:
> > Well, sorry, I was not completely explicit. What I meant was:
> >
> > 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
>
> Yes, but no.
>
> The $(SED) '/^splashimage/d' case needs to be done in all cases if
> BR2_TARGET_GRUB_SPLASH is disabled (regardless whether we're using
> initrd/initramfs or a real iso9660 for the rootfs).
>
> However, the $(INSTALL) needs to be done only if
> BR2_TARGET_GRUB_SPLASH=y *and* we are using an initrd/initramfs, not if
> we are using directly the rootfs in the iso9660 filesystem. So this
> part only needs to be done if BR2_TARGET_GRUB_SPLASH=y *and*
> ROOTFS_ISO9660_USE_INITRD=YES.
Sorry, but we're speaking patch 2 here, so there is yet absolutely no
reference to the initrd/initramfs/direct rootfs stuff, which you're only
introducing much later in the series.
This patch is changing this code:
21 ifeq ($(BR2_TARGET_GRUB_SPLASH),)
22 $(SED) '/^splashimage/d' $(ISO9660_TARGET_DIR)/boot/grub/menu.lst
23 else
24 $(INSTALL) -D -m 0644 boot/grub/splash.xpm.gz \
25 $(ISO9660_TARGET_DIR)/splash.xpm.gz
26 endif
into:
12 ifeq ($(BR2_TARGET_GRUB_SPLASH),)
13 define ROOTFS_ISO9660_SPLASHSCREEN
14 $(SED) '/^splashimage/d' $(ISO9660_TARGET_DIR)/boot/grub/menu.lst
15 endef
16 else
17 define ROOTFS_ISO9660_SPLASHSCREEN
18 $(INSTALL) -D -m 0644 boot/grub/splash.xpm.gz \
19 $(ISO9660_TARGET_DIR)/splash.xpm.gz
20 endef
21 endif
So, what I suggested above is exactly the *same* condition, but with the
'if' and 'else' clauses reversed:
12 ifeq ($(BR2_TARGET_GRUB_SPLASH),y)
13 define ROOTFS_ISO9660_SPLASHSCREEN
14 $(INSTALL) -D -m 0644 boot/grub/splash.xpm.gz \
15 $(ISO9660_TARGET_DIR)/splash.xpm.gz
16 endef
17 else
18 define ROOTFS_ISO9660_SPLASHSCREEN
19 $(SED) '/^splashimage/d' $(ISO9660_TARGET_DIR)/boot/grub/menu.lst
20 endef
21 endif
See?
Now, what you said is true further in the series, and indeed does not
warrant changing the ordering of the 'if' and 'else' clauses, as that
would need to be switched again later.
And I maintain my ACK on this patch! ;-)
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] 55+ messages in thread
* [Buildroot] [PATCH 02/12] fs/iso9660: convert to the filesystem infrastructure
2015-06-04 15:05 ` [Buildroot] [PATCH 02/12] fs/iso9660: convert to the filesystem infrastructure Thomas Petazzoni
2015-06-05 11:59 ` Samuel Martin
2015-06-05 20:58 ` Yann E. MORIN
@ 2015-06-05 22:44 ` Arnout Vandecappelle
2015-06-06 0:43 ` Thomas Petazzoni
2 siblings, 1 reply; 55+ messages in thread
From: Arnout Vandecappelle @ 2015-06-05 22:44 UTC (permalink / raw)
To: buildroot
On 06/04/15 17:05, Thomas Petazzoni wrote:
> Now that we have <fs>_POST_GEN_HOOKS, there is nothing that prevents
> the iso9660 filesystem logic from using the common filesystem
> infrastructure.
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
However, instead of doing the cleanup in a _POST_GEN_HOOK, I would skip the
cleanup completely. We normally don't clean up any build artefact, so why should
we do it here?
Regards,
Arnout
[snip]
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286500
Essensium/Mind http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
^ permalink raw reply [flat|nested] 55+ messages in thread
* [Buildroot] [PATCH 02/12] fs/iso9660: convert to the filesystem infrastructure
2015-06-05 22:44 ` Arnout Vandecappelle
@ 2015-06-06 0:43 ` Thomas Petazzoni
2015-06-07 19:53 ` Yann E. MORIN
0 siblings, 1 reply; 55+ messages in thread
From: Thomas Petazzoni @ 2015-06-06 0:43 UTC (permalink / raw)
To: buildroot
Dear Arnout Vandecappelle,
On Sat, 06 Jun 2015 00:44:45 +0200, Arnout Vandecappelle wrote:
> On 06/04/15 17:05, Thomas Petazzoni wrote:
> > Now that we have <fs>_POST_GEN_HOOKS, there is nothing that prevents
> > the iso9660 filesystem logic from using the common filesystem
> > infrastructure.
> >
> > Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
>
> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
>
> However, instead of doing the cleanup in a _POST_GEN_HOOK, I would skip the
> cleanup completely. We normally don't clean up any build artefact, so why should
> we do it here?
That's actually true. The only advantage by cleaning up is that if you
redo a build and the contents of the temporary directory have changed,
it's properly accurate. But we could also do:
remove temp dir
create empty temp dir
do stuff
create image
and that's it.
Do you want to change it in this direction?
Thanks,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 55+ messages in thread
* [Buildroot] [PATCH 02/12] fs/iso9660: convert to the filesystem infrastructure
2015-06-06 0:43 ` Thomas Petazzoni
@ 2015-06-07 19:53 ` Yann E. MORIN
0 siblings, 0 replies; 55+ messages in thread
From: Yann E. MORIN @ 2015-06-07 19:53 UTC (permalink / raw)
To: buildroot
Thomas, All,
On 2015-06-06 02:43 +0200, Thomas Petazzoni spake thusly:
> Dear Arnout Vandecappelle,
>
> On Sat, 06 Jun 2015 00:44:45 +0200, Arnout Vandecappelle wrote:
> > On 06/04/15 17:05, Thomas Petazzoni wrote:
> > > Now that we have <fs>_POST_GEN_HOOKS, there is nothing that prevents
> > > the iso9660 filesystem logic from using the common filesystem
> > > infrastructure.
> > >
> > > Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> >
> > Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
> >
> > However, instead of doing the cleanup in a _POST_GEN_HOOK, I would skip the
> > cleanup completely. We normally don't clean up any build artefact, so why should
> > we do it here?
>
> That's actually true. The only advantage by cleaning up is that if you
> redo a build and the contents of the temporary directory have changed,
> it's properly accurate.
Not if the image building itself fails (e.g. FS too large for iso9660,
or whatever other reason), so the temporary directory would still be
there.
> But we could also do:
>
> remove temp dir
> create empty temp dir
> do stuff
> create image
>
> and that's it.
>
> Do you want to change it in this direction?
That would be better, yes.
However, that really spawns the question of whether Buildroot should
provide a clean, empty temporary directory from the onset, so we don't
re-invent this logic everywhere.
I'll see what I can do about that...
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] 55+ messages in thread
* [Buildroot] [PATCH 03/12] fs/iso9660: use if ... endif block instead of depends on
2015-06-04 15:05 [Buildroot] [PATCH 00/12] iso9660 support improvements Thomas Petazzoni
2015-06-04 15:05 ` [Buildroot] [PATCH 01/12] fs/common: add <fs>_POST_GEN_HOOKS support Thomas Petazzoni
2015-06-04 15:05 ` [Buildroot] [PATCH 02/12] fs/iso9660: convert to the filesystem infrastructure Thomas Petazzoni
@ 2015-06-04 15:05 ` Thomas Petazzoni
2015-06-05 12:01 ` Samuel Martin
2015-06-05 21:00 ` Yann E. MORIN
2015-06-04 15:05 ` [Buildroot] [PATCH 04/12] fs/iso9660: enable Joliet extension Thomas Petazzoni
` (8 subsequent siblings)
11 siblings, 2 replies; 55+ messages in thread
From: Thomas Petazzoni @ 2015-06-04 15:05 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>
---
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] 55+ messages in thread* [Buildroot] [PATCH 03/12] fs/iso9660: use if ... endif block instead of depends on
2015-06-04 15:05 ` [Buildroot] [PATCH 03/12] fs/iso9660: use if ... endif block instead of depends on Thomas Petazzoni
@ 2015-06-05 12:01 ` Samuel Martin
2015-06-05 21:00 ` Yann E. MORIN
1 sibling, 0 replies; 55+ messages in thread
From: Samuel Martin @ 2015-06-05 12:01 UTC (permalink / raw)
To: buildroot
On Thu, Jun 4, 2015 at 5:05 PM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> 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>
Regards,
--
Samuel
^ permalink raw reply [flat|nested] 55+ messages in thread
* [Buildroot] [PATCH 03/12] fs/iso9660: use if ... endif block instead of depends on
2015-06-04 15:05 ` [Buildroot] [PATCH 03/12] fs/iso9660: use if ... endif block instead of depends on Thomas Petazzoni
2015-06-05 12:01 ` Samuel Martin
@ 2015-06-05 21:00 ` Yann E. MORIN
1 sibling, 0 replies; 55+ messages in thread
From: Yann E. MORIN @ 2015-06-05 21:00 UTC (permalink / raw)
To: buildroot
Thomas, All,
On 2015-06-04 17:05 +0200, Thomas Petazzoni spake thusly:
> 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: "Yann E. MORIN" <yann.morin.1998@free.fr>
Maybe you could re-order that to come earlier in the series (since it is
an easy patch, and does not depend on the previous ones)?
Regards,
Yann E. MORIN.
> ---
> 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
>
> _______________________________________________
> 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] 55+ messages in thread
* [Buildroot] [PATCH 04/12] fs/iso9660: enable Joliet extension
2015-06-04 15:05 [Buildroot] [PATCH 00/12] iso9660 support improvements Thomas Petazzoni
` (2 preceding siblings ...)
2015-06-04 15:05 ` [Buildroot] [PATCH 03/12] fs/iso9660: use if ... endif block instead of depends on Thomas Petazzoni
@ 2015-06-04 15:05 ` Thomas Petazzoni
2015-06-05 12:06 ` Samuel Martin
2015-06-05 21:18 ` Yann E. MORIN
2015-06-04 15:05 ` [Buildroot] [PATCH 05/12] fs/iso9660: rename all variables to use the ROOTFS_ISO9660 prefix Thomas Petazzoni
` (7 subsequent siblings)
11 siblings, 2 replies; 55+ messages in thread
From: Thomas Petazzoni @ 2015-06-04 15:05 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>
---
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 5a29673..6a04fe6 100644
--- a/fs/iso9660/iso9660.mk
+++ b/fs/iso9660/iso9660.mk
@@ -44,7 +44,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] 55+ messages in thread* [Buildroot] [PATCH 04/12] fs/iso9660: enable Joliet extension
2015-06-04 15:05 ` [Buildroot] [PATCH 04/12] fs/iso9660: enable Joliet extension Thomas Petazzoni
@ 2015-06-05 12:06 ` Samuel Martin
2015-06-05 21:18 ` Yann E. MORIN
1 sibling, 0 replies; 55+ messages in thread
From: Samuel Martin @ 2015-06-05 12:06 UTC (permalink / raw)
To: buildroot
On Thu, Jun 4, 2015 at 5:05 PM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> 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>
Regards,
--
Samuel
^ permalink raw reply [flat|nested] 55+ messages in thread
* [Buildroot] [PATCH 04/12] fs/iso9660: enable Joliet extension
2015-06-04 15:05 ` [Buildroot] [PATCH 04/12] fs/iso9660: enable Joliet extension Thomas Petazzoni
2015-06-05 12:06 ` Samuel Martin
@ 2015-06-05 21:18 ` Yann E. MORIN
2015-06-06 0:46 ` Thomas Petazzoni
1 sibling, 1 reply; 55+ messages in thread
From: Yann E. MORIN @ 2015-06-05 21:18 UTC (permalink / raw)
To: buildroot
Thomas, All,
On 2015-06-04 17:05 +0200, Thomas Petazzoni spake thusly:
> 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: "Yann E. MORIN" <yann.morin.1998@free.fr>
However, see a comment, below...
> ---
> 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 5a29673..6a04fe6 100644
> --- a/fs/iso9660/iso9660.mk
> +++ b/fs/iso9660/iso9660.mk
> @@ -44,7 +44,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 \
Only tangentially related to your change:
-R is for RockRidge, but it seems using -r would be better:
-r This is like the -R option, but file ownership and modes are set
to more useful values. [--snip--]
Reading the full entry for -r is instructive, and makes it sound like
that's what we would want to use instead of -R.
Regards,
Yann E. MORIN.
> -no-emul-boot -boot-load-size 4 -boot-info-table \
> -o $@ $(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] 55+ messages in thread* [Buildroot] [PATCH 04/12] fs/iso9660: enable Joliet extension
2015-06-05 21:18 ` Yann E. MORIN
@ 2015-06-06 0:46 ` Thomas Petazzoni
2015-06-06 9:02 ` Yann E. MORIN
0 siblings, 1 reply; 55+ messages in thread
From: Thomas Petazzoni @ 2015-06-06 0:46 UTC (permalink / raw)
To: buildroot
Dear Yann E. MORIN,
On Fri, 5 Jun 2015 23:18:40 +0200, Yann E. MORIN wrote:
> Only tangentially related to your change:
>
> -R is for RockRidge, but it seems using -r would be better:
>
> -r This is like the -R option, but file ownership and modes are set
> to more useful values. [--snip--]
>
> Reading the full entry for -r is instructive, and makes it sound like
> that's what we would want to use instead of -R.
I'm actually not sure. Let's list what -r is doing compared to -R:
* Setting uid:gid to 0:0 to all files. We already do that using
fakeroot, and we also set some other ownership for specific files
using <pkg>_PERMISSIONS and the device table. So getting all of that
reset to 0:0 is wrong.
* Changing permissions all over. Why do we care? We already take care
of dependencies, and -r makes everything world-readable, which we
clearly don't want.
* It apparently clears the set-id bit, which would make all setuid
application to break.
So, in fact I'm rather convinced that we should keep -R and not use -r.
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 55+ messages in thread
* [Buildroot] [PATCH 04/12] fs/iso9660: enable Joliet extension
2015-06-06 0:46 ` Thomas Petazzoni
@ 2015-06-06 9:02 ` Yann E. MORIN
0 siblings, 0 replies; 55+ messages in thread
From: Yann E. MORIN @ 2015-06-06 9:02 UTC (permalink / raw)
To: buildroot
Thomas, All,
On 2015-06-06 02:46 +0200, Thomas Petazzoni spake thusly:
> On Fri, 5 Jun 2015 23:18:40 +0200, Yann E. MORIN wrote:
>
> > Only tangentially related to your change:
> >
> > -R is for RockRidge, but it seems using -r would be better:
> >
> > -r This is like the -R option, but file ownership and modes are set
> > to more useful values. [--snip--]
> >
> > Reading the full entry for -r is instructive, and makes it sound like
> > that's what we would want to use instead of -R.
>
> I'm actually not sure. Let's list what -r is doing compared to -R:
>
> * Setting uid:gid to 0:0 to all files. We already do that using
> fakeroot, and we also set some other ownership for specific files
> using <pkg>_PERMISSIONS and the device table. So getting all of that
> reset to 0:0 is wrong.
>
> * Changing permissions all over. Why do we care? We already take care
> of dependencies, and -r makes everything world-readable, which we
> clearly don't want.
>
> * It apparently clears the set-id bit, which would make all setuid
> application to break.
>
> So, in fact I'm rather convinced that we should keep -R and not use -r.
Yes, you're right! :-)
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] 55+ messages in thread
* [Buildroot] [PATCH 05/12] fs/iso9660: rename all variables to use the ROOTFS_ISO9660 prefix
2015-06-04 15:05 [Buildroot] [PATCH 00/12] iso9660 support improvements Thomas Petazzoni
` (3 preceding siblings ...)
2015-06-04 15:05 ` [Buildroot] [PATCH 04/12] fs/iso9660: enable Joliet extension Thomas Petazzoni
@ 2015-06-04 15:05 ` Thomas Petazzoni
2015-06-05 12:08 ` Samuel Martin
2015-06-05 21:20 ` Yann E. MORIN
2015-06-04 15:05 ` [Buildroot] [PATCH 06/12] fs/iso9660: change the location of the splash image Thomas Petazzoni
` (6 subsequent siblings)
11 siblings, 2 replies; 55+ messages in thread
From: Thomas Petazzoni @ 2015-06-04 15:05 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>
---
fs/iso9660/iso9660.mk | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/fs/iso9660/iso9660.mk b/fs/iso9660/iso9660.mk
index 6a04fe6..0c7ef3b 100644
--- a/fs/iso9660/iso9660.mk
+++ b/fs/iso9660/iso9660.mk
@@ -4,39 +4,39 @@
#
################################################################################
-ISO9660_TARGET_DIR = $(BUILD_DIR)/iso9660
-ISO9660_BOOT_MENU := $(call qstrip,$(BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU))
+ROOTFS_ISO9660_TARGET_DIR = $(BUILD_DIR)/iso9660
+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),)
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
else
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
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
$(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
@@ -46,11 +46,11 @@ 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
define ROOTFS_ISO9660_REMOVE_TEMPDIR
- $(RM) -rf $(ISO9660_TARGET_DIR)
+ $(RM) -rf $(ROOTFS_ISO9660_TARGET_DIR)
endef
ROOTFS_ISO9660_POST_GEN_HOOKS += ROOTFS_ISO9660_REMOVE_TEMPDIR
--
2.1.0
^ permalink raw reply related [flat|nested] 55+ messages in thread* [Buildroot] [PATCH 05/12] fs/iso9660: rename all variables to use the ROOTFS_ISO9660 prefix
2015-06-04 15:05 ` [Buildroot] [PATCH 05/12] fs/iso9660: rename all variables to use the ROOTFS_ISO9660 prefix Thomas Petazzoni
@ 2015-06-05 12:08 ` Samuel Martin
2015-06-05 21:20 ` Yann E. MORIN
1 sibling, 0 replies; 55+ messages in thread
From: Samuel Martin @ 2015-06-05 12:08 UTC (permalink / raw)
To: buildroot
On Thu, Jun 4, 2015 at 5:05 PM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> 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>
Regards,
--
Samuel
^ permalink raw reply [flat|nested] 55+ messages in thread
* [Buildroot] [PATCH 05/12] fs/iso9660: rename all variables to use the ROOTFS_ISO9660 prefix
2015-06-04 15:05 ` [Buildroot] [PATCH 05/12] fs/iso9660: rename all variables to use the ROOTFS_ISO9660 prefix Thomas Petazzoni
2015-06-05 12:08 ` Samuel Martin
@ 2015-06-05 21:20 ` Yann E. MORIN
1 sibling, 0 replies; 55+ messages in thread
From: Yann E. MORIN @ 2015-06-05 21:20 UTC (permalink / raw)
To: buildroot
Thomas, All,
On 2015-06-04 17:05 +0200, Thomas Petazzoni spake thusly:
> 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: "Yann E. MORIN" <yann.morin.1998@free.fr>
Regards,
Yann E. MORIN.
> ---
> fs/iso9660/iso9660.mk | 24 ++++++++++++------------
> 1 file changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/fs/iso9660/iso9660.mk b/fs/iso9660/iso9660.mk
> index 6a04fe6..0c7ef3b 100644
> --- a/fs/iso9660/iso9660.mk
> +++ b/fs/iso9660/iso9660.mk
> @@ -4,39 +4,39 @@
> #
> ################################################################################
>
> -ISO9660_TARGET_DIR = $(BUILD_DIR)/iso9660
> -ISO9660_BOOT_MENU := $(call qstrip,$(BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU))
> +ROOTFS_ISO9660_TARGET_DIR = $(BUILD_DIR)/iso9660
> +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),)
> 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
> else
> 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
> 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
> $(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
> @@ -46,11 +46,11 @@ 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
>
> define ROOTFS_ISO9660_REMOVE_TEMPDIR
> - $(RM) -rf $(ISO9660_TARGET_DIR)
> + $(RM) -rf $(ROOTFS_ISO9660_TARGET_DIR)
> endef
>
> ROOTFS_ISO9660_POST_GEN_HOOKS += ROOTFS_ISO9660_REMOVE_TEMPDIR
> --
> 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] 55+ messages in thread
* [Buildroot] [PATCH 06/12] fs/iso9660: change the location of the splash image
2015-06-04 15:05 [Buildroot] [PATCH 00/12] iso9660 support improvements Thomas Petazzoni
` (4 preceding siblings ...)
2015-06-04 15:05 ` [Buildroot] [PATCH 05/12] fs/iso9660: rename all variables to use the ROOTFS_ISO9660 prefix Thomas Petazzoni
@ 2015-06-04 15:05 ` Thomas Petazzoni
2015-06-05 12:09 ` Samuel Martin
2015-06-05 21:30 ` Yann E. MORIN
2015-06-04 15:05 ` [Buildroot] [PATCH 07/12] fs/iso9660: prepare cleaner kernel/initrd path handling Thomas Petazzoni
` (5 subsequent siblings)
11 siblings, 2 replies; 55+ messages in thread
From: Thomas Petazzoni @ 2015-06-04 15:05 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 in
$(TARGET_DIR).
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
fs/iso9660/iso9660.mk | 2 +-
| 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/iso9660/iso9660.mk b/fs/iso9660/iso9660.mk
index 0c7ef3b..80971d3 100644
--- a/fs/iso9660/iso9660.mk
+++ b/fs/iso9660/iso9660.mk
@@ -16,7 +16,7 @@ endef
else
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
endif
--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] 55+ messages in thread* [Buildroot] [PATCH 06/12] fs/iso9660: change the location of the splash image
2015-06-04 15:05 ` [Buildroot] [PATCH 06/12] fs/iso9660: change the location of the splash image Thomas Petazzoni
@ 2015-06-05 12:09 ` Samuel Martin
2015-06-05 21:30 ` Yann E. MORIN
1 sibling, 0 replies; 55+ messages in thread
From: Samuel Martin @ 2015-06-05 12:09 UTC (permalink / raw)
To: buildroot
On Thu, Jun 4, 2015 at 5:05 PM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> 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 in
> $(TARGET_DIR).
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Samuel Martin <s.martin49@gmail.com>
Regards,
--
Samuel
^ permalink raw reply [flat|nested] 55+ messages in thread
* [Buildroot] [PATCH 06/12] fs/iso9660: change the location of the splash image
2015-06-04 15:05 ` [Buildroot] [PATCH 06/12] fs/iso9660: change the location of the splash image Thomas Petazzoni
2015-06-05 12:09 ` Samuel Martin
@ 2015-06-05 21:30 ` Yann E. MORIN
1 sibling, 0 replies; 55+ messages in thread
From: Yann E. MORIN @ 2015-06-05 21:30 UTC (permalink / raw)
To: buildroot
Thomas, All,
On 2015-06-04 17:05 +0200, Thomas Petazzoni spake thusly:
> 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 in
> $(TARGET_DIR).
It looks like that last sentence is incorrect (missing verb?) and I had
a bit of a hard time udnerstanding what it meant (but see later).
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
(Comments below...)
> ---
> 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 0c7ef3b..80971d3 100644
> --- a/fs/iso9660/iso9660.mk
> +++ b/fs/iso9660/iso9660.mk
> @@ -16,7 +16,7 @@ endef
> else
> 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
Since iso9660 already depends on grub, grub would have already installed
that file in $(TARGET_DIR) (and that's where I finally understood that
sentence of yours, above).
Also, fs images are generated after the post-build scripts and rootfs
overlays, which would leave to the user the option to replace the
bootsplash with its own.
So. maybe we should grab the image from $(TARGET_DIR) rather than picking
it from the grub package?
Of course, that should be a separate patch.
Regards,
Yann E. MORIN.
> endef
> endif
>
> 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
>
> _______________________________________________
> 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] 55+ messages in thread
* [Buildroot] [PATCH 07/12] fs/iso9660: prepare cleaner kernel/initrd path handling
2015-06-04 15:05 [Buildroot] [PATCH 00/12] iso9660 support improvements Thomas Petazzoni
` (5 preceding siblings ...)
2015-06-04 15:05 ` [Buildroot] [PATCH 06/12] fs/iso9660: change the location of the splash image Thomas Petazzoni
@ 2015-06-04 15:05 ` Thomas Petazzoni
2015-06-05 12:11 ` Samuel Martin
` (2 more replies)
2015-06-04 15:05 ` [Buildroot] [PATCH 08/12] fs/iso9660: support building a real iso9660 filesystem Thomas Petazzoni
` (4 subsequent siblings)
11 siblings, 3 replies; 55+ messages in thread
From: Thomas Petazzoni @ 2015-06-04 15:05 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.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
fs/iso9660/Config.in | 5 +++++
fs/iso9660/iso9660.mk | 11 ++++++++---
| 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 80971d3..2a8a447 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
@@ -36,7 +38,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
--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] 55+ messages in thread* [Buildroot] [PATCH 07/12] fs/iso9660: prepare cleaner kernel/initrd path handling
2015-06-04 15:05 ` [Buildroot] [PATCH 07/12] fs/iso9660: prepare cleaner kernel/initrd path handling Thomas Petazzoni
@ 2015-06-05 12:11 ` Samuel Martin
2015-06-05 21:43 ` Yann E. MORIN
2015-06-05 22:06 ` Yann E. MORIN
2 siblings, 0 replies; 55+ messages in thread
From: Samuel Martin @ 2015-06-05 12:11 UTC (permalink / raw)
To: buildroot
On Thu, Jun 4, 2015 at 5:05 PM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> 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.
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Samuel Martin <s.martin49@gmail.com>
Regards,
--
Samuel
^ permalink raw reply [flat|nested] 55+ messages in thread
* [Buildroot] [PATCH 07/12] fs/iso9660: prepare cleaner kernel/initrd path handling
2015-06-04 15:05 ` [Buildroot] [PATCH 07/12] fs/iso9660: prepare cleaner kernel/initrd path handling Thomas Petazzoni
2015-06-05 12:11 ` Samuel Martin
@ 2015-06-05 21:43 ` Yann E. MORIN
2015-06-05 22:06 ` Yann E. MORIN
2 siblings, 0 replies; 55+ messages in thread
From: Yann E. MORIN @ 2015-06-05 21:43 UTC (permalink / raw)
To: buildroot
Thomas, All,
On 2015-06-04 17:05 +0200, Thomas Petazzoni spake thusly:
> 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.
>
> 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 | 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 80971d3..2a8a447 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
>
> @@ -36,7 +38,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
>
> _______________________________________________
> 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] 55+ messages in thread
* [Buildroot] [PATCH 07/12] fs/iso9660: prepare cleaner kernel/initrd path handling
2015-06-04 15:05 ` [Buildroot] [PATCH 07/12] fs/iso9660: prepare cleaner kernel/initrd path handling Thomas Petazzoni
2015-06-05 12:11 ` Samuel Martin
2015-06-05 21:43 ` Yann E. MORIN
@ 2015-06-05 22:06 ` Yann E. MORIN
2 siblings, 0 replies; 55+ messages in thread
From: Yann E. MORIN @ 2015-06-05 22:06 UTC (permalink / raw)
To: buildroot
Thomas, All,
On 2015-06-04 17:05 +0200, Thomas Petazzoni spake thusly:
> 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.
You forgot to document in the commit log that you are also moving the
locations where the kernel image and initrd files are now stored.
I understand this is needed later on when we add support for using the
iso9660 directly as the rootfs, because the kernel will be forcibly
installed in the target (with the appropriate Kconfig option), and that
you also move the initrd to match.
Still, this is missing in the commit log (and I forgot to write this in
my previous mail, sorry).
However, I trust you to come up with a delightfull-to-read explanation,
so my Acked-by still stands! ;-)
Regards,
Yann E. MORIN.
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---
> 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 80971d3..2a8a447 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
>
> @@ -36,7 +38,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
>
> _______________________________________________
> 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] 55+ messages in thread
* [Buildroot] [PATCH 08/12] fs/iso9660: support building a real iso9660 filesystem
2015-06-04 15:05 [Buildroot] [PATCH 00/12] iso9660 support improvements Thomas Petazzoni
` (6 preceding siblings ...)
2015-06-04 15:05 ` [Buildroot] [PATCH 07/12] fs/iso9660: prepare cleaner kernel/initrd path handling Thomas Petazzoni
@ 2015-06-04 15:05 ` Thomas Petazzoni
2015-06-05 12:57 ` Samuel Martin
2015-06-05 22:13 ` Yann E. MORIN
2015-06-04 15:05 ` [Buildroot] [PATCH 09/12] fs/iso9660: add support for isolinux Thomas Petazzoni
` (3 subsequent siblings)
11 siblings, 2 replies; 55+ messages in thread
From: Thomas Petazzoni @ 2015-06-04 15:05 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 | 103 +++++++++++++++++++++++++++++++++++++++-----------
| 2 +-
3 files changed, 106 insertions(+), 26 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 2a8a447..a3572e2 100644
--- a/fs/iso9660/iso9660.mk
+++ b/fs/iso9660/iso9660.mk
@@ -4,49 +4,104 @@
#
################################################################################
-ROOTFS_ISO9660_TARGET_DIR = $(BUILD_DIR)/iso9660
+#
+# 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_ROOTFS_ISO9660_INITRD),y)
+ROOTFS_ISO9660_USE_INITRD = YES
+endif
+
+ifeq ($(BR2_TARGET_ROOTFS_INITRAMFS),y)
+ROOTFS_ISO9660_USE_INITRD = YES
+endif
+
+ifeq ($(ROOTFS_ISO9660_USE_INITRD),YES)
+ROOTFS_ISO9660_TARGET_DIR = $(BUILD_DIR)/iso9660
+else
+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_SPLASHSCREEN
+define ROOTFS_ISO9660_DISABLE_SPLASHSCREEN
$(SED) '/^splashimage/d' $(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/menu.lst
endef
-else
-define ROOTFS_ISO9660_SPLASHSCREEN
+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
+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 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
-ifeq ($(BR2_TARGET_ROOTFS_INITRAMFS),y)
-define ROOTFS_ISO9660_INITRD
- $(SED) '/__INITRD_PATH__/d' $(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/menu.lst
+# 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
-else
-define ROOTFS_ISO9660_INITRD
+
+ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_COPY_KERNEL
+
+# Copy initrd to temporary filesystem if needed
+ifeq ($(BR2_TARGET_ROOTFS_INITRAMFS),)
+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
+else
+ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_DISABLE_EXTERNAL_INITRD
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
- $(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 # BR2_TARGET_ROOTFS_ISO9660_INITRD
+
+ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_DISABLE_EXTERNAL_INITRD
+
+endif # BR2_TARGET_ROOTFS_ISO9660_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 \
@@ -54,10 +109,12 @@ define ROOTFS_ISO9660_CMD
-o $@ $(ROOTFS_ISO9660_TARGET_DIR)
endef
+ifeq ($(ROOTFS_ISO9660_USE_INITRD),YES)
define ROOTFS_ISO9660_REMOVE_TEMPDIR
$(RM) -rf $(ROOTFS_ISO9660_TARGET_DIR)
endef
ROOTFS_ISO9660_POST_GEN_HOOKS += ROOTFS_ISO9660_REMOVE_TEMPDIR
+endif
$(eval $(call ROOTFS_TARGET,iso9660))
--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] 55+ messages in thread* [Buildroot] [PATCH 08/12] fs/iso9660: support building a real iso9660 filesystem
2015-06-04 15:05 ` [Buildroot] [PATCH 08/12] fs/iso9660: support building a real iso9660 filesystem Thomas Petazzoni
@ 2015-06-05 12:57 ` Samuel Martin
2015-06-05 22:13 ` Yann E. MORIN
1 sibling, 0 replies; 55+ messages in thread
From: Samuel Martin @ 2015-06-05 12:57 UTC (permalink / raw)
To: buildroot
Hi Thomas, all,
On Thu, Jun 4, 2015 at 5:05 PM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> 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 | 103 +++++++++++++++++++++++++++++++++++++++-----------
> fs/iso9660/menu.lst | 2 +-
> 3 files changed, 106 insertions(+), 26 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 2a8a447..a3572e2 100644
> --- a/fs/iso9660/iso9660.mk
> +++ b/fs/iso9660/iso9660.mk
> @@ -4,49 +4,104 @@
> #
> ################################################################################
>
> -ROOTFS_ISO9660_TARGET_DIR = $(BUILD_DIR)/iso9660
> +#
> +# 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_ROOTFS_ISO9660_INITRD),y)
> +ROOTFS_ISO9660_USE_INITRD = YES
> +endif
> +
> +ifeq ($(BR2_TARGET_ROOTFS_INITRAMFS),y)
> +ROOTFS_ISO9660_USE_INITRD = YES
> +endif
> +
> +ifeq ($(ROOTFS_ISO9660_USE_INITRD),YES)
> +ROOTFS_ISO9660_TARGET_DIR = $(BUILD_DIR)/iso9660
> +else
> +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_SPLASHSCREEN
> +define ROOTFS_ISO9660_DISABLE_SPLASHSCREEN
> $(SED) '/^splashimage/d' $(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/menu.lst
> endef
> -else
> -define ROOTFS_ISO9660_SPLASHSCREEN
> +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
> +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 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
>
> -ifeq ($(BR2_TARGET_ROOTFS_INITRAMFS),y)
> -define ROOTFS_ISO9660_INITRD
> - $(SED) '/__INITRD_PATH__/d' $(ROOTFS_ISO9660_TARGET_DIR)/boot/grub/menu.lst
> +# 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
> -else
> -define ROOTFS_ISO9660_INITRD
> +
> +ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_COPY_KERNEL
> +
> +# Copy initrd to temporary filesystem if needed
> +ifeq ($(BR2_TARGET_ROOTFS_INITRAMFS),)
> +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
> +else
> +ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_DISABLE_EXTERNAL_INITRD
> 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
> - $(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 # BR2_TARGET_ROOTFS_ISO9660_INITRD
s/BR2_TARGET_ROOTFS_ISO9660_INITRD/ROOTFS_ISO9660_USE_INITRD/
> +
> +ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_DISABLE_EXTERNAL_INITRD
> +
> +endif # BR2_TARGET_ROOTFS_ISO9660_INITRD
s/BR2_TARGET_ROOTFS_ISO9660_INITRD/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 \
> @@ -54,10 +109,12 @@ define ROOTFS_ISO9660_CMD
> -o $@ $(ROOTFS_ISO9660_TARGET_DIR)
> endef
>
> +ifeq ($(ROOTFS_ISO9660_USE_INITRD),YES)
> define ROOTFS_ISO9660_REMOVE_TEMPDIR
> $(RM) -rf $(ROOTFS_ISO9660_TARGET_DIR)
> endef
>
> ROOTFS_ISO9660_POST_GEN_HOOKS += ROOTFS_ISO9660_REMOVE_TEMPDIR
> +endif
>
> $(eval $(call ROOTFS_TARGET,iso9660))
> 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
Regards,
--
Samuel
^ permalink raw reply [flat|nested] 55+ messages in thread
* [Buildroot] [PATCH 08/12] fs/iso9660: support building a real iso9660 filesystem
2015-06-04 15:05 ` [Buildroot] [PATCH 08/12] fs/iso9660: support building a real iso9660 filesystem Thomas Petazzoni
2015-06-05 12:57 ` Samuel Martin
@ 2015-06-05 22:13 ` Yann E. MORIN
1 sibling, 0 replies; 55+ messages in thread
From: Yann E. MORIN @ 2015-06-05 22:13 UTC (permalink / raw)
To: buildroot
Thomas, All,
On 2015-06-04 17:05 +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.
Besides the comments by Samuel, here are mines...
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
[--SNIP--]
> diff --git a/fs/iso9660/iso9660.mk b/fs/iso9660/iso9660.mk
> index 2a8a447..a3572e2 100644
> --- a/fs/iso9660/iso9660.mk
> +++ b/fs/iso9660/iso9660.mk
[--SNIP--]
> +ifeq ($(BR2_TARGET_ROOTFS_ISO9660_INITRD),y)
> +ROOTFS_ISO9660_USE_INITRD = YES
since we're later using that in an ifeq() clause, maybe we could use 'y'
here...
> +endif
> +
> +ifeq ($(BR2_TARGET_ROOTFS_INITRAMFS),y)
> +ROOTFS_ISO9660_USE_INITRD = YES
... and here, so the ifeq() clause looks like the others.
I understand using 'YES' also makes it obvious this is not a kconfig
option, but a Makefile variable, so I would not mind keeping 'YES' if
you prefer.
> +endif
> +
> +ifeq ($(ROOTFS_ISO9660_USE_INITRD),YES)
Here, we'd have:
ifeq ($(ROOTFS_ISO9660_USE_INITRD),y)
which looks more like what we are used to.
> +ROOTFS_ISO9660_TARGET_DIR = $(BUILD_DIR)/iso9660
Maybe it would be time to move that to a differently-named directory,
like:
ROOTFS_ISO9660_TARGET_DIR = $(BUILD_DIR)/rootfs-iso9660.tmp
so it is obvious it is not (and does not conflict with) a package build
directory.
And ultimately, we should really introduce a temproray, scratch location
where anyone is free to drop files/directories at will without polluting
$(BUILD_DIR) (the downlaod scripts would also benefit from that
scratchable location, btw).
[--SNIP--]
> +# Copy initrd to temporary filesystem if needed
> +ifeq ($(BR2_TARGET_ROOTFS_INITRAMFS),)
We usually use positive logic and test against 'y', unless there's no
'else' clause. So, maybe:
ifeq ($(BR2_TARGET_ROOTFS_INITRAMFS),y)
ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_DISABLE_EXTERNAL_INITRD
else
blabla
endif # BR2_TARGET_ROOTFS_INITRAMFS
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] 55+ messages in thread
* [Buildroot] [PATCH 09/12] fs/iso9660: add support for isolinux
2015-06-04 15:05 [Buildroot] [PATCH 00/12] iso9660 support improvements Thomas Petazzoni
` (7 preceding siblings ...)
2015-06-04 15:05 ` [Buildroot] [PATCH 08/12] fs/iso9660: support building a real iso9660 filesystem Thomas Petazzoni
@ 2015-06-04 15:05 ` Thomas Petazzoni
2015-06-05 13:02 ` Samuel Martin
2015-06-05 22:38 ` Yann E. MORIN
2015-06-04 15:05 ` [Buildroot] [PATCH 10/12] fs/iso9660: add hybrid image support Thomas Petazzoni
` (2 subsequent siblings)
11 siblings, 2 replies; 55+ messages in thread
From: Thomas Petazzoni @ 2015-06-04 15:05 UTC (permalink / raw)
To: buildroot
Until now, the ISO9660 image generation logic was only supporting the
Grub bootloader. This commit adds support to use isolinux (from
syslinux) instead of grub, as an option.
From a Config.in point of view, we switch from having
BR2_TARGET_ROOTFS_ISO9660 select BR2_TARGET_GRUB to using a 'depends
on'. This is because for isolinux, we would need to select
BR2_TARGET_SYSLINUX_ISOLINUX, but BR2_TARGET_SYSLINUX_ISOLINUX is part
of a Kconfig 'choice', so we can't do a select. So instead, the
BR2_TARGET_ROOTFS_ISO9660 now depends on either BR2_TARGET_GRUB or
BR2_TARGET_SYSLINUX_ISOLINUX being available.
The .mk file is re-organized a bit to be a bit more generic:
- a variable called ROOTFS_ISO9660_BOOTLOADER_CONFIG_PATH is
introduced to reflect the path to the bootloader configuration file
(which is later modified to replace __KERNEL_PATH__ and
__INITRD_PATH__ to the appropriate values)
- a variable called ROOTFS_ISO9660_BOOT_IMAGE is introduced to give
the path to the bootloader-specific boot image, as needed by
genisoimage -b option.
- a variable called ROOTFS_ISO9660_INSTALL_BOOTLOADER is introduced
with the commands needed to do the bootloader-specific installation
steps
This patch is based on previous patches submitted by Jerome Sagnole
<jean.sorgemoel@laposte.net> and No? Rubinstein
<nrubinstein@aldebaran.com>.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
fs/iso9660/Config.in | 35 ++++++++++++++++++++++++++---------
fs/iso9660/iso9660.mk | 43 ++++++++++++++++++++++++++++++++++---------
fs/iso9660/isolinux.cfg | 6 ++++++
3 files changed, 66 insertions(+), 18 deletions(-)
create mode 100644 fs/iso9660/isolinux.cfg
diff --git a/fs/iso9660/Config.in b/fs/iso9660/Config.in
index e300fdb..e7bf3c3 100644
--- a/fs/iso9660/Config.in
+++ b/fs/iso9660/Config.in
@@ -2,10 +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
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,13 +21,30 @@ config BR2_TARGET_ROOTFS_ISO9660
if BR2_TARGET_ROOTFS_ISO9660
+choice
+ prompt "Bootloader"
+
+config BR2_TARGET_ROOTFS_ISO9660_GRUB
+ bool "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"
+ string "Bootloader configuration 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
@@ -44,6 +60,7 @@ 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 or isolinux to be built"
depends on BR2_i386 || BR2_x86_64
- depends on !BR2_LINUX_KERNEL
+ 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 a3572e2..c95485c 100644
--- a/fs/iso9660/iso9660.mk
+++ b/fs/iso9660/iso9660.mk
@@ -40,32 +40,56 @@ else
ROOTFS_ISO9660_TARGET_DIR = $(TARGET_DIR)
endif
-define ROOTFS_ISO9660_PREPARATION
+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_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 $(SYSLINUX_DIR)/bios/core/isolinux.bin \
+ $(ROOTFS_ISO9660_TARGET_DIR)/isolinux/isolinux.bin
+ $(INSTALL) -D -m 0644 $(SYSLINUX_DIR)/bios/com32/elflink/ldlinux/ldlinux.c32 \
+ $(ROOTFS_ISO9660_TARGET_DIR)/isolinux/ldlinux.c32
+endef
+endif
+
+define ROOTFS_ISO9660_PREPARATION
$(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)
+ $(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_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
+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)
-# 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 boot/grub/splash.xpm.gz \
@@ -73,6 +97,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
@@ -89,7 +114,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
else
@@ -104,7 +129,7 @@ endif # BR2_TARGET_ROOTFS_ISO9660_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
diff --git a/fs/iso9660/isolinux.cfg b/fs/iso9660/isolinux.cfg
new file mode 100644
index 0000000..2bdf48b
--- /dev/null
+++ b/fs/iso9660/isolinux.cfg
@@ -0,0 +1,6 @@
+default 1
+display sample.msg
+label 1
+ kernel __KERNEL_PATH__
+ append initrd=__INITRD_PATH__
+ append root=/dev/sr0
--
2.1.0
^ permalink raw reply related [flat|nested] 55+ messages in thread* [Buildroot] [PATCH 09/12] fs/iso9660: add support for isolinux
2015-06-04 15:05 ` [Buildroot] [PATCH 09/12] fs/iso9660: add support for isolinux Thomas Petazzoni
@ 2015-06-05 13:02 ` Samuel Martin
2015-06-05 22:38 ` Yann E. MORIN
1 sibling, 0 replies; 55+ messages in thread
From: Samuel Martin @ 2015-06-05 13:02 UTC (permalink / raw)
To: buildroot
Hi Thomas, all,
On Thu, Jun 4, 2015 at 5:05 PM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Until now, the ISO9660 image generation logic was only supporting the
> Grub bootloader. This commit adds support to use isolinux (from
> syslinux) instead of grub, as an option.
>
> From a Config.in point of view, we switch from having
> BR2_TARGET_ROOTFS_ISO9660 select BR2_TARGET_GRUB to using a 'depends
> on'. This is because for isolinux, we would need to select
> BR2_TARGET_SYSLINUX_ISOLINUX, but BR2_TARGET_SYSLINUX_ISOLINUX is part
> of a Kconfig 'choice', so we can't do a select. So instead, the
> BR2_TARGET_ROOTFS_ISO9660 now depends on either BR2_TARGET_GRUB or
> BR2_TARGET_SYSLINUX_ISOLINUX being available.
>
> The .mk file is re-organized a bit to be a bit more generic:
>
> - a variable called ROOTFS_ISO9660_BOOTLOADER_CONFIG_PATH is
> introduced to reflect the path to the bootloader configuration file
> (which is later modified to replace __KERNEL_PATH__ and
> __INITRD_PATH__ to the appropriate values)
>
> - a variable called ROOTFS_ISO9660_BOOT_IMAGE is introduced to give
> the path to the bootloader-specific boot image, as needed by
> genisoimage -b option.
>
> - a variable called ROOTFS_ISO9660_INSTALL_BOOTLOADER is introduced
> with the commands needed to do the bootloader-specific installation
> steps
>
> This patch is based on previous patches submitted by Jerome Sagnole
> <jean.sorgemoel@laposte.net> and No? Rubinstein
> <nrubinstein@aldebaran.com>.
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---
> fs/iso9660/Config.in | 35 ++++++++++++++++++++++++++---------
> fs/iso9660/iso9660.mk | 43 ++++++++++++++++++++++++++++++++++---------
> fs/iso9660/isolinux.cfg | 6 ++++++
> 3 files changed, 66 insertions(+), 18 deletions(-)
> create mode 100644 fs/iso9660/isolinux.cfg
>
> diff --git a/fs/iso9660/Config.in b/fs/iso9660/Config.in
> index e300fdb..e7bf3c3 100644
> --- a/fs/iso9660/Config.in
> +++ b/fs/iso9660/Config.in
> @@ -2,10 +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
> 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,13 +21,30 @@ config BR2_TARGET_ROOTFS_ISO9660
>
> if BR2_TARGET_ROOTFS_ISO9660
>
> +choice
> + prompt "Bootloader"
> +
> +config BR2_TARGET_ROOTFS_ISO9660_GRUB
> + bool "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"
> + string "Bootloader configuration 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
> @@ -44,6 +60,7 @@ 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 or isolinux to be built"
> depends on BR2_i386 || BR2_x86_64
> - depends on !BR2_LINUX_KERNEL
> + 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 a3572e2..c95485c 100644
> --- a/fs/iso9660/iso9660.mk
> +++ b/fs/iso9660/iso9660.mk
Grub is no longer required dependency, so it should be removed from
the common dependency list (line 27).
> @@ -40,32 +40,56 @@ else
> ROOTFS_ISO9660_TARGET_DIR = $(TARGET_DIR)
> endif
>
> -define ROOTFS_ISO9660_PREPARATION
> +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_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 $(SYSLINUX_DIR)/bios/core/isolinux.bin \
> + $(ROOTFS_ISO9660_TARGET_DIR)/isolinux/isolinux.bin
> + $(INSTALL) -D -m 0644 $(SYSLINUX_DIR)/bios/com32/elflink/ldlinux/ldlinux.c32 \
> + $(ROOTFS_ISO9660_TARGET_DIR)/isolinux/ldlinux.c32
> +endef
> +endif
> +
> +define ROOTFS_ISO9660_PREPARATION
> $(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)
> + $(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_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
> +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)
>
> -# 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 boot/grub/splash.xpm.gz \
> @@ -73,6 +97,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
> @@ -89,7 +114,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
> else
> @@ -104,7 +129,7 @@ endif # BR2_TARGET_ROOTFS_ISO9660_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
> diff --git a/fs/iso9660/isolinux.cfg b/fs/iso9660/isolinux.cfg
> new file mode 100644
> index 0000000..2bdf48b
> --- /dev/null
> +++ b/fs/iso9660/isolinux.cfg
> @@ -0,0 +1,6 @@
> +default 1
> +display sample.msg
> +label 1
> + kernel __KERNEL_PATH__
> + append initrd=__INITRD_PATH__
> + append root=/dev/sr0
> --
> 2.1.0
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
Regards,
--
Samuel
^ permalink raw reply [flat|nested] 55+ messages in thread
* [Buildroot] [PATCH 09/12] fs/iso9660: add support for isolinux
2015-06-04 15:05 ` [Buildroot] [PATCH 09/12] fs/iso9660: add support for isolinux Thomas Petazzoni
2015-06-05 13:02 ` Samuel Martin
@ 2015-06-05 22:38 ` Yann E. MORIN
2015-06-06 1:03 ` Thomas Petazzoni
1 sibling, 1 reply; 55+ messages in thread
From: Yann E. MORIN @ 2015-06-05 22:38 UTC (permalink / raw)
To: buildroot
Thomas, All,
On 2015-06-04 17:05 +0200, Thomas Petazzoni spake thusly:
> Until now, the ISO9660 image generation logic was only supporting the
> Grub bootloader. This commit adds support to use isolinux (from
> syslinux) instead of grub, as an option.
>
> From a Config.in point of view, we switch from having
> BR2_TARGET_ROOTFS_ISO9660 select BR2_TARGET_GRUB to using a 'depends
> on'. This is because for isolinux, we would need to select
> BR2_TARGET_SYSLINUX_ISOLINUX, but BR2_TARGET_SYSLINUX_ISOLINUX is part
> of a Kconfig 'choice', so we can't do a select. So instead, the
> BR2_TARGET_ROOTFS_ISO9660 now depends on either BR2_TARGET_GRUB or
> BR2_TARGET_SYSLINUX_ISOLINUX being available.
>
> The .mk file is re-organized a bit to be a bit more generic:
>
> - a variable called ROOTFS_ISO9660_BOOTLOADER_CONFIG_PATH is
> introduced to reflect the path to the bootloader configuration file
> (which is later modified to replace __KERNEL_PATH__ and
> __INITRD_PATH__ to the appropriate values)
>
> - a variable called ROOTFS_ISO9660_BOOT_IMAGE is introduced to give
> the path to the bootloader-specific boot image, as needed by
> genisoimage -b option.
>
> - a variable called ROOTFS_ISO9660_INSTALL_BOOTLOADER is introduced
> with the commands needed to do the bootloader-specific installation
> steps
This patch is quite large, and could benefit from being splitted in three:
- first patch introduces the ROOTFS_ISO9660_BOOTLOADER_CONFIG_PATH and
ROOTFS_ISO9660_BOOT_IMAGE variables
- second patch to introduce the bootloader choice, but with only a
single entrey 'grub', and the .mk re-organisation (still with only
grub handling),
- then a third patch adds isolinux support.
That'd make it easier to review...
Since I'm quite interested in the end-result of this series
(multi-format bootable images), I can help if you don;t have time. Just
ping me... ;-)
(I tried to see if previous patches could be splitted, but you already
did a pretty good job at that! :-) )
> This patch is based on previous patches submitted by Jerome Sagnole
> <jean.sorgemoel@laposte.net> and No? Rubinstein
> <nrubinstein@aldebaran.com>.
Thanks guys! :-)
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
[--SNIP--]
> diff --git a/fs/iso9660/iso9660.mk b/fs/iso9660/iso9660.mk
> index a3572e2..c95485c 100644
> --- a/fs/iso9660/iso9660.mk
> +++ b/fs/iso9660/iso9660.mk
> @@ -40,32 +40,56 @@ else
> ROOTFS_ISO9660_TARGET_DIR = $(TARGET_DIR)
> endif
>
> -define ROOTFS_ISO9660_PREPARATION
> +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_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 $(SYSLINUX_DIR)/bios/core/isolinux.bin \
> + $(ROOTFS_ISO9660_TARGET_DIR)/isolinux/isolinux.bin
> + $(INSTALL) -D -m 0644 $(SYSLINUX_DIR)/bios/com32/elflink/ldlinux/ldlinux.c32 \
> + $(ROOTFS_ISO9660_TARGET_DIR)/isolinux/ldlinux.c32
syslinux/isolinux already installs isolinux.bin and the .c32 modules in
$(BINARIES_DIR)/syslinux, so you should probably get them from there,
rather than cherry-pick from the package dir (in case a later version
bump moves them, like it did when I last updated the package).
Except ldlinux.c32 is not systematically installed; we should probably
change that first (what use would we have of a syslinux/isolinux that
can't load a Linux kernel? :-] ).
> +endef
> +endif
> +
> +define ROOTFS_ISO9660_PREPARATION
> $(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)
> + $(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_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
> +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)
>
> -# 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 boot/grub/splash.xpm.gz \
> @@ -73,6 +97,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
> @@ -89,7 +114,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
> else
> @@ -104,7 +129,7 @@ endif # BR2_TARGET_ROOTFS_ISO9660_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
> diff --git a/fs/iso9660/isolinux.cfg b/fs/iso9660/isolinux.cfg
> new file mode 100644
> index 0000000..2bdf48b
> --- /dev/null
> +++ b/fs/iso9660/isolinux.cfg
> @@ -0,0 +1,6 @@
> +default 1
> +display sample.msg
Where's that file comming from?
Also, there is the possibility for syslinux/isolinux to display
graphics, too, but it is much more invvolved (but that'd be great!)
Regards,
Yann E. MORIN.
> +label 1
> + kernel __KERNEL_PATH__
> + append 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] 55+ messages in thread* [Buildroot] [PATCH 09/12] fs/iso9660: add support for isolinux
2015-06-05 22:38 ` Yann E. MORIN
@ 2015-06-06 1:03 ` Thomas Petazzoni
2015-06-06 9:25 ` Yann E. MORIN
0 siblings, 1 reply; 55+ messages in thread
From: Thomas Petazzoni @ 2015-06-06 1:03 UTC (permalink / raw)
To: buildroot
Yann,
On Sat, 6 Jun 2015 00:38:56 +0200, Yann E. MORIN wrote:
> This patch is quite large, and could benefit from being splitted in three:
>
> - first patch introduces the ROOTFS_ISO9660_BOOTLOADER_CONFIG_PATH and
> ROOTFS_ISO9660_BOOT_IMAGE variables
>
> - second patch to introduce the bootloader choice, but with only a
> single entrey 'grub', and the .mk re-organisation (still with only
> grub handling),
>
> - then a third patch adds isolinux support.
>
> That'd make it easier to review...
True, this seems like a good split. I'll work on that.
> Since I'm quite interested in the end-result of this series
> (multi-format bootable images), I can help if you don;t have time. Just
> ping me... ;-)
Actually, your review is arriving at exactly the right time. I'm having
a 10+ hours flight tomorrow, which will be a perfect opportunity to
prepare a v2 of this series.
I did the v1 on the 10+ hours flight to go, so having something to do
on the return trip is great.
> > + $(INSTALL) -D -m 0644 $(SYSLINUX_DIR)/bios/com32/elflink/ldlinux/ldlinux.c32 \
> > + $(ROOTFS_ISO9660_TARGET_DIR)/isolinux/ldlinux.c32
>
> syslinux/isolinux already installs isolinux.bin and the .c32 modules in
> $(BINARIES_DIR)/syslinux, so you should probably get them from there,
> rather than cherry-pick from the package dir (in case a later version
> bump moves them, like it did when I last updated the package).
>
> Except ldlinux.c32 is not systematically installed; we should probably
> change that first (what use would we have of a syslinux/isolinux that
> can't load a Linux kernel? :-] ).
True, will change.
> > diff --git a/fs/iso9660/isolinux.cfg b/fs/iso9660/isolinux.cfg
> > new file mode 100644
> > index 0000000..2bdf48b
> > --- /dev/null
> > +++ b/fs/iso9660/isolinux.cfg
> > @@ -0,0 +1,6 @@
> > +default 1
> > +display sample.msg
>
> Where's that file comming from?
>
> Also, there is the possibility for syslinux/isolinux to display
> graphics, too, but it is much more invvolved (but that'd be great!)
The precise reason why there is this leftover "display sample.msg" is
because I tried to get the splash image support of isolinux to work.
I didn't succeed and gave up (no Internet access while flying, so I was
limited to just the isolinux documentation and source code) but forgot
to kill that line. I'll kill it off for now, until someone interested
enough in having a splash image with isolinux works on that.
Thanks again for the review!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 55+ messages in thread
* [Buildroot] [PATCH 09/12] fs/iso9660: add support for isolinux
2015-06-06 1:03 ` Thomas Petazzoni
@ 2015-06-06 9:25 ` Yann E. MORIN
0 siblings, 0 replies; 55+ messages in thread
From: Yann E. MORIN @ 2015-06-06 9:25 UTC (permalink / raw)
To: buildroot
Thomas, All,
On 2015-06-06 03:03 +0200, Thomas Petazzoni spake thusly:
> On Sat, 6 Jun 2015 00:38:56 +0200, Yann E. MORIN wrote:
> > Since I'm quite interested in the end-result of this series
> > (multi-format bootable images), I can help if you don;t have time. Just
> > ping me... ;-)
>
> Actually, your review is arriving at exactly the right time. I'm having
> a 10+ hours flight tomorrow, which will be a perfect opportunity to
> prepare a v2 of this series.
>
> I did the v1 on the 10+ hours flight to go, so having something to do
> on the return trip is great.
Happy flight! ;-)
> > > diff --git a/fs/iso9660/isolinux.cfg b/fs/iso9660/isolinux.cfg
> > > new file mode 100644
> > > index 0000000..2bdf48b
> > > --- /dev/null
> > > +++ b/fs/iso9660/isolinux.cfg
> > > @@ -0,0 +1,6 @@
> > > +default 1
> > > +display sample.msg
> >
> > Where's that file comming from?
> >
> > Also, there is the possibility for syslinux/isolinux to display
> > graphics, too, but it is much more invvolved (but that'd be great!)
>
> The precise reason why there is this leftover "display sample.msg" is
> because I tried to get the splash image support of isolinux to work.
> I didn't succeed and gave up (no Internet access while flying, so I was
> limited to just the isolinux documentation and source code) but forgot
> to kill that line. I'll kill it off for now, until someone interested
> enough in having a splash image with isolinux works on that.
Yeah, I tried a lng time ago, and it was not easy. Hopefully, things
have changed since then, but that can indeed be left as an exercise for
the interested party! :-]
I'm not too fond of splahscreens in the bootloader anyway, so I won't
press for that. I really prefer to have a quick boot that gives me a
running kernel as fast as possible, so I can get access to the
framebuffer from userland, and splash an image early in the boot process
from userland. Bootloader-born splashscreen is for those that can't do
fast boot! Hehehe! :-]
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] 55+ messages in thread
* [Buildroot] [PATCH 10/12] fs/iso9660: add hybrid image support
2015-06-04 15:05 [Buildroot] [PATCH 00/12] iso9660 support improvements Thomas Petazzoni
` (8 preceding siblings ...)
2015-06-04 15:05 ` [Buildroot] [PATCH 09/12] fs/iso9660: add support for isolinux Thomas Petazzoni
@ 2015-06-04 15:05 ` Thomas Petazzoni
2015-06-05 13:07 ` Samuel Martin
2015-06-05 22:51 ` Yann E. MORIN
2015-06-04 15:05 ` [Buildroot] [PATCH 11/12] grub2: prepare and install El Torito image Thomas Petazzoni
2015-06-04 15:05 ` [Buildroot] [PATCH 12/12] fs/iso9660: add support for grub2 Thomas Petazzoni
11 siblings, 2 replies; 55+ messages in thread
From: Thomas Petazzoni @ 2015-06-04 15:05 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 e7bf3c3..1b1f090 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 grub or isolinux to be built"
diff --git a/fs/iso9660/iso9660.mk b/fs/iso9660/iso9660.mk
index c95485c..792a770 100644
--- a/fs/iso9660/iso9660.mk
+++ b/fs/iso9660/iso9660.mk
@@ -142,4 +142,12 @@ endef
ROOTFS_ISO9660_POST_GEN_HOOKS += ROOTFS_ISO9660_REMOVE_TEMPDIR
endif
+ifeq ($(BR2_TARGET_ROOTFS_ISO9660_HYBRID),y)
+define ROOTFS_ISO9660_GEN_HYBRID
+ $(HOST_DIR)/usr/bin/isohybrid $@
+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] 55+ messages in thread* [Buildroot] [PATCH 10/12] fs/iso9660: add hybrid image support
2015-06-04 15:05 ` [Buildroot] [PATCH 10/12] fs/iso9660: add hybrid image support Thomas Petazzoni
@ 2015-06-05 13:07 ` Samuel Martin
2015-06-05 22:51 ` Yann E. MORIN
1 sibling, 0 replies; 55+ messages in thread
From: Samuel Martin @ 2015-06-05 13:07 UTC (permalink / raw)
To: buildroot
Thomas, all,
On Thu, Jun 4, 2015 at 5:05 PM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> 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>
Reviewed-by: Samuel Martin <s.martin49@gmail.com>
Regards,
--
Samuel
^ permalink raw reply [flat|nested] 55+ messages in thread
* [Buildroot] [PATCH 10/12] fs/iso9660: add hybrid image support
2015-06-04 15:05 ` [Buildroot] [PATCH 10/12] fs/iso9660: add hybrid image support Thomas Petazzoni
2015-06-05 13:07 ` Samuel Martin
@ 2015-06-05 22:51 ` Yann E. MORIN
1 sibling, 0 replies; 55+ messages in thread
From: Yann E. MORIN @ 2015-06-05 22:51 UTC (permalink / raw)
To: buildroot
Thomas, All,
On 2015-06-04 17:05 +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>
However, a comment, below...
> diff --git a/fs/iso9660/iso9660.mk b/fs/iso9660/iso9660.mk
> index c95485c..792a770 100644
> --- a/fs/iso9660/iso9660.mk
> +++ b/fs/iso9660/iso9660.mk
> @@ -142,4 +142,12 @@ endef
> ROOTFS_ISO9660_POST_GEN_HOOKS += ROOTFS_ISO9660_REMOVE_TEMPDIR
> endif
>
> +ifeq ($(BR2_TARGET_ROOTFS_ISO9660_HYBRID),y)
> +define ROOTFS_ISO9660_GEN_HYBRID
> + $(HOST_DIR)/usr/bin/isohybrid $@
The default partition type is 0x17, which is nothing very interesting.
What about setting it to 0x96 instead, which is 'ISO-9660 file system':
https://en.wikipedia.org/wiki/Partition_type
Regards,
Yann E. MORIN.
> +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] 55+ messages in thread
* [Buildroot] [PATCH 11/12] grub2: prepare and install El Torito image
2015-06-04 15:05 [Buildroot] [PATCH 00/12] iso9660 support improvements Thomas Petazzoni
` (9 preceding siblings ...)
2015-06-04 15:05 ` [Buildroot] [PATCH 10/12] fs/iso9660: add hybrid image support Thomas Petazzoni
@ 2015-06-04 15:05 ` Thomas Petazzoni
2015-06-05 13:21 ` Samuel Martin
` (2 more replies)
2015-06-04 15:05 ` [Buildroot] [PATCH 12/12] fs/iso9660: add support for grub2 Thomas Petazzoni
11 siblings, 3 replies; 55+ messages in thread
From: Thomas Petazzoni @ 2015-06-04 15:05 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..dd04bb3 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) > $(HOST_DIR)/usr/lib/grub/$(GRUB2_TUPLE)/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] 55+ messages in thread* [Buildroot] [PATCH 11/12] grub2: prepare and install El Torito image
2015-06-04 15:05 ` [Buildroot] [PATCH 11/12] grub2: prepare and install El Torito image Thomas Petazzoni
@ 2015-06-05 13:21 ` Samuel Martin
2015-06-05 22:55 ` Yann E. MORIN
2015-06-05 23:09 ` Yann E. MORIN
2 siblings, 0 replies; 55+ messages in thread
From: Samuel Martin @ 2015-06-05 13:21 UTC (permalink / raw)
To: buildroot
Thomas, all,
On Thu, Jun 4, 2015 at 5:05 PM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> 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
s/thr/the/
> 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>
Reviewed-by: Samuel Martin <s.martin49@gmail.com>
Regards,
--
Samuel
^ permalink raw reply [flat|nested] 55+ messages in thread
* [Buildroot] [PATCH 11/12] grub2: prepare and install El Torito image
2015-06-04 15:05 ` [Buildroot] [PATCH 11/12] grub2: prepare and install El Torito image Thomas Petazzoni
2015-06-05 13:21 ` Samuel Martin
@ 2015-06-05 22:55 ` Yann E. MORIN
2015-06-05 23:09 ` Yann E. MORIN
2 siblings, 0 replies; 55+ messages in thread
From: Yann E. MORIN @ 2015-06-05 22:55 UTC (permalink / raw)
To: buildroot
Thomas, All,
On 2015-06-04 17:05 +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>
> ---
> boot/grub2/grub2.mk | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/boot/grub2/grub2.mk b/boot/grub2/grub2.mk
> index 697f0ad..dd04bb3 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) > $(HOST_DIR)/usr/lib/grub/$(GRUB2_TUPLE)/grub-eltorito.img
Purely cosmetic comment: since we anyway have long lines, I'd rather see
the two input file on the same line, like:
cat $(HOST_DIR)/usr/lib/grub/$(GRUB2_TUPLE)/cdboot.img $(GRUB2_IMAGE) \
> $(HOST_DIR)/usr/lib/grub/$(GRUB2_TUPLE)/grub-eltorito.img
Otherwise:
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Regards,
Yann E. MORIN.
> 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] 55+ messages in thread* [Buildroot] [PATCH 11/12] grub2: prepare and install El Torito image
2015-06-04 15:05 ` [Buildroot] [PATCH 11/12] grub2: prepare and install El Torito image Thomas Petazzoni
2015-06-05 13:21 ` Samuel Martin
2015-06-05 22:55 ` Yann E. MORIN
@ 2015-06-05 23:09 ` Yann E. MORIN
2015-06-06 0:57 ` Thomas Petazzoni
2 siblings, 1 reply; 55+ messages in thread
From: Yann E. MORIN @ 2015-06-05 23:09 UTC (permalink / raw)
To: buildroot
Thomas, All,
On 2015-06-04 17:05 +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>
> ---
> boot/grub2/grub2.mk | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/boot/grub2/grub2.mk b/boot/grub2/grub2.mk
> index 697f0ad..dd04bb3 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) > $(HOST_DIR)/usr/lib/grub/$(GRUB2_TUPLE)/grub-eltorito.img
In retrospect, I think you should install that in $(BINARIES_DIR), like
is done for $(GRUB2_IMAGE), not in $(HOST_DIR).
Regards,
Yann E. MORIN.
> 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] 55+ messages in thread
* [Buildroot] [PATCH 11/12] grub2: prepare and install El Torito image
2015-06-05 23:09 ` Yann E. MORIN
@ 2015-06-06 0:57 ` Thomas Petazzoni
2015-06-06 9:31 ` Yann E. MORIN
0 siblings, 1 reply; 55+ messages in thread
From: Thomas Petazzoni @ 2015-06-06 0:57 UTC (permalink / raw)
To: buildroot
Dear Yann E. MORIN,
On Sat, 6 Jun 2015 01:09:11 +0200, Yann E. MORIN wrote:
> > diff --git a/boot/grub2/grub2.mk b/boot/grub2/grub2.mk
> > index 697f0ad..dd04bb3 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) > $(HOST_DIR)/usr/lib/grub/$(GRUB2_TUPLE)/grub-eltorito.img
>
> In retrospect, I think you should install that in $(BINARIES_DIR), like
> is done for $(GRUB2_IMAGE), not in $(HOST_DIR).
Well, I had a reason to install it in HOST_DIR rather than
BINARIES_DIR. Since I'm producing this image unconditionally, even if
the user is not interested in ISO9660, I didn't want to clutter
BINARIES_DIR with this file, which would appear as soon as the user
enables grub2. So I preferred to install it together with all the other
"internal" Grub images in HOST_DIR, and pick it up from there in the
iso9660.mk logic.
Now, if you think cluttering BINARIES_DIR with this file only useful
for ISO booting as soon as Grub 2 is enabled is fine, then I'll happily
change it.
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] 55+ messages in thread
* [Buildroot] [PATCH 11/12] grub2: prepare and install El Torito image
2015-06-06 0:57 ` Thomas Petazzoni
@ 2015-06-06 9:31 ` Yann E. MORIN
0 siblings, 0 replies; 55+ messages in thread
From: Yann E. MORIN @ 2015-06-06 9:31 UTC (permalink / raw)
To: buildroot
Thomas, All,
On 2015-06-06 02:57 +0200, Thomas Petazzoni spake thusly:
> On Sat, 6 Jun 2015 01:09:11 +0200, Yann E. MORIN wrote:
>
> > > diff --git a/boot/grub2/grub2.mk b/boot/grub2/grub2.mk
> > > index 697f0ad..dd04bb3 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) > $(HOST_DIR)/usr/lib/grub/$(GRUB2_TUPLE)/grub-eltorito.img
> >
> > In retrospect, I think you should install that in $(BINARIES_DIR), like
> > is done for $(GRUB2_IMAGE), not in $(HOST_DIR).
>
> Well, I had a reason to install it in HOST_DIR rather than
> BINARIES_DIR. Since I'm producing this image unconditionally, even if
> the user is not interested in ISO9660, I didn't want to clutter
> BINARIES_DIR with this file, which would appear as soon as the user
> enables grub2. So I preferred to install it together with all the other
> "internal" Grub images in HOST_DIR, and pick it up from there in the
> iso9660.mk logic.
>
> Now, if you think cluttering BINARIES_DIR with this file only useful
> for ISO booting as soon as Grub 2 is enabled is fine, then I'll happily
> change it.
Well, yes, I'd prefer that's what we do, for these reasons:
- first, that file is really small,
- second, we already do that for other bootloaders (like
rpi-firmware),
- finally, we never said we only installed only the strictly
minimum set of files,
- if the user really does not want it, there's still the
post-build scripts to remove that extra file.
> Thanks for the review!
My pleasure! :-)
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] 55+ messages in thread
* [Buildroot] [PATCH 12/12] fs/iso9660: add support for grub2
2015-06-04 15:05 [Buildroot] [PATCH 00/12] iso9660 support improvements Thomas Petazzoni
` (10 preceding siblings ...)
2015-06-04 15:05 ` [Buildroot] [PATCH 11/12] grub2: prepare and install El Torito image Thomas Petazzoni
@ 2015-06-04 15:05 ` Thomas Petazzoni
2015-06-05 13:30 ` Samuel Martin
2015-06-05 23:07 ` Yann E. MORIN
11 siblings, 2 replies; 55+ messages in thread
From: Thomas Petazzoni @ 2015-06-04 15:05 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 1b1f090..0bd09b9 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 "Bootloader configuration 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 grub or isolinux to be built"
+comment "iso image needs a Linux kernel and grub(2) 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..b8329c3
--- /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 console=tty1
+ initrd __INITRD_PATH__
+}
diff --git a/fs/iso9660/iso9660.mk b/fs/iso9660/iso9660.mk
index 792a770..9378d50 100644
--- a/fs/iso9660/iso9660.mk
+++ b/fs/iso9660/iso9660.mk
@@ -49,6 +49,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 $(HOST_DIR)/usr/lib/grub/$(GRUB2_TUPLE)/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] 55+ messages in thread* [Buildroot] [PATCH 12/12] fs/iso9660: add support for grub2
2015-06-04 15:05 ` [Buildroot] [PATCH 12/12] fs/iso9660: add support for grub2 Thomas Petazzoni
@ 2015-06-05 13:30 ` Samuel Martin
2015-06-05 23:07 ` Yann E. MORIN
1 sibling, 0 replies; 55+ messages in thread
From: Samuel Martin @ 2015-06-05 13:30 UTC (permalink / raw)
To: buildroot
Thomas, all,
On Thu, Jun 4, 2015 at 5:05 PM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> 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: Samuel Martin <s.martin49@gmail.com>
Regards,
--
Samuel
^ permalink raw reply [flat|nested] 55+ messages in thread
* [Buildroot] [PATCH 12/12] fs/iso9660: add support for grub2
2015-06-04 15:05 ` [Buildroot] [PATCH 12/12] fs/iso9660: add support for grub2 Thomas Petazzoni
2015-06-05 13:30 ` Samuel Martin
@ 2015-06-05 23:07 ` Yann E. MORIN
2015-06-06 0:59 ` Thomas Petazzoni
1 sibling, 1 reply; 55+ messages in thread
From: Yann E. MORIN @ 2015-06-05 23:07 UTC (permalink / raw)
To: buildroot
Thomas, All,
On 2015-06-04 17:05 +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>
[--SNIP--]
> -comment "iso image needs a Linux kernel and grub or isolinux to be built"
> +comment "iso image needs a Linux kernel and grub(2) or isolinux to be built"
I ghave to admit that reading this comment using the usual associativity
of 'and' and 'or' makes it sound that we either want
- a kernel and grub/grub2,
- or isolinux
/me should sometime go back to the real world! :-]
> diff --git a/fs/iso9660/grub.cfg b/fs/iso9660/grub.cfg
> new file mode 100644
> index 0000000..b8329c3
> --- /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 console=tty1
Why do you forcibly pass the console setting?
> + initrd __INITRD_PATH__
> +}
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] 55+ messages in thread* [Buildroot] [PATCH 12/12] fs/iso9660: add support for grub2
2015-06-05 23:07 ` Yann E. MORIN
@ 2015-06-06 0:59 ` Thomas Petazzoni
2015-06-06 9:18 ` Yann E. MORIN
0 siblings, 1 reply; 55+ messages in thread
From: Thomas Petazzoni @ 2015-06-06 0:59 UTC (permalink / raw)
To: buildroot
Dear Yann E. MORIN,
On Sat, 6 Jun 2015 01:07:56 +0200, Yann E. MORIN wrote:
> > -comment "iso image needs a Linux kernel and grub or isolinux to be built"
> > +comment "iso image needs a Linux kernel and grub(2) or isolinux to be built"
>
> I ghave to admit that reading this comment using the usual associativity
> of 'and' and 'or' makes it sound that we either want
> - a kernel and grub/grub2,
> - or isolinux
True. Any suggestion to improve that?
comment "iso image needs (a Linux kernel && (grub(2) || isolinux))"
is probably a bit hard to read, no ? :-)
> > +menuentry "Buildroot" {
> > + linux __KERNEL_PATH__ root=/dev/sr0 console=tty1
>
> Why do you forcibly pass the console setting?
That's a good question. We don't have that for the grub and isolinux
case, so I'm not sure why I added that for the grub2 case. I'll kill
that and retest. Thanks for noticing!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 55+ messages in thread* [Buildroot] [PATCH 12/12] fs/iso9660: add support for grub2
2015-06-06 0:59 ` Thomas Petazzoni
@ 2015-06-06 9:18 ` Yann E. MORIN
0 siblings, 0 replies; 55+ messages in thread
From: Yann E. MORIN @ 2015-06-06 9:18 UTC (permalink / raw)
To: buildroot
Thomas, All,
On 2015-06-06 02:59 +0200, Thomas Petazzoni spake thusly:
> Dear Yann E. MORIN,
>
> On Sat, 6 Jun 2015 01:07:56 +0200, Yann E. MORIN wrote:
>
> > > -comment "iso image needs a Linux kernel and grub or isolinux to be built"
> > > +comment "iso image needs a Linux kernel and grub(2) or isolinux to be built"
> >
> > I ghave to admit that reading this comment using the usual associativity
> > of 'and' and 'or' makes it sound that we either want
> > - a kernel and grub/grub2,
> > - or isolinux
>
> True. Any suggestion to improve that?
>
> comment "iso image needs (a Linux kernel && (grub(2) || isolinux))"
>
> is probably a bit hard to read, no ? :-)
iso image needs a Linux kernel and one of grub, grub2 or isolinux
> > > +menuentry "Buildroot" {
> > > + linux __KERNEL_PATH__ root=/dev/sr0 console=tty1
> >
> > Why do you forcibly pass the console setting?
>
> That's a good question. We don't have that for the grub and isolinux
> case, so I'm not sure why I added that for the grub2 case. I'll kill
> that and retest. Thanks for noticing!
He! :-)
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] 55+ messages in thread