diff mbox

[PATCHv2,12/15] fs/iso9660: add isolinux support

Message ID 1433802108-14351-13-git-send-email-thomas.petazzoni@free-electrons.com
State Accepted
Headers show

Commit Message

Thomas Petazzoni June 8, 2015, 10:21 p.m. UTC
After all the preparation commits, this commit finally adds the
iso9660 support itself. Besides adding a new Config.in entry, a little
bit of .mk code and the isolinux.cfg default configuration, not much
is needed.

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

Comments

Yann E. MORIN June 14, 2015, 3:47 p.m. UTC | #1
Thomas, All,

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

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

Yet, see a little comment below...

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

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

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

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

Thanks! :-)

Regards,
Yann E. MORIN.

> +endef
>  endif
>  
>  define ROOTFS_ISO9660_PREPARATION
> diff --git a/fs/iso9660/isolinux.cfg b/fs/iso9660/isolinux.cfg
> new file mode 100644
> index 0000000..28be4fa
> --- /dev/null
> +++ b/fs/iso9660/isolinux.cfg
> @@ -0,0 +1,5 @@
> +default 1
> +label 1
> +      kernel __KERNEL_PATH__
> +      initrd __INITRD_PATH__
> +      append root=/dev/sr0
> -- 
> 2.1.0
> 
> _______________________________________________
> buildroot mailing list
> buildroot@busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
Thomas Petazzoni June 14, 2015, 9:24 p.m. UTC | #2
Dear Yann E. MORIN,

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

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

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

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

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

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

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

Thanks for the review!

Thomas
diff mbox

Patch

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