diff mbox

[v5,1/2] modify bootloader option for iso9660 filesystem image (grub)

Message ID 1393707656-29664-1-git-send-email-jean.sorgemoel@laposte.net
State Superseded
Headers show

Commit Message

jean March 1, 2014, 9 p.m. UTC
From: Jerome Sagnole <jean.sorgemoel@laposte.net>

Changelog :

patch v1 : new branch to generate iso with bootloader isolinux

patch v2 : add bootloader option for iso9660 filesystem image (isolinux)
        addon to include comment Arnout Vandecappelle
        simplify code
          1/ I suppress redundant comment
          2/ Suppress menu and use conditional (replace 'depends on' by 'if/end$
          3/ Modify comment
          4/ suppress option (keyboard, ...)
          5/ replace 8 x space by tabulation
                File : fs/isolinux/isolinux.mk
          6/ suppress extension 'BR2_'
          7/ use variable 'ISOLINUX_DIR'
          8/ suppress keyboard option
          9/ I can't use command '$(INSTALL) -D' beacause I don't define filena$
         10/ Hide command genisoimage (with option $@)

patch v3 : add bootloader option for iso9660 filesystem image (isolinux)
        addon to include comment Thomas Petazzoni & Arnout Vandecappelle
        modify comment
        default generate iso with grub bootloader
        you can select isolinux bootloader
        detail : (module fs/iso9660)
          option to select bootloader (grub/isolinux)
          file(s) bootloader configuration
          option to copy file(s) on iso (only for isolinux)
          option to create iso with long filenames (Joliet format)
          option to create iso with POSIX file system (file mode, uid, gid, ...)
          define volume label
          define parameter input charset
          can use initramfs (if activate), also cpio (like initrd)

patch v4 : add bootloader option for iso9660 filesystem image (isolinux)
        addon to include comment Arnout Vandecappelle & Thomas Petazzoni
        add choise to select bootloader in iso9660 menu
        modify comment
        seperate code in two patch
          1st patch : update iso9660 with grub
          2nd patch : add new bootloader isolinux

patch v5 part 1: modify bootloader option for iso9660 filesystem image (grub)
        addon to include comment Arnout Vandecappelle & Martin Bark
        modify option to include files and directories in iso image
          suppress option BR2_TARGET_ROOTFS_ISOLINUX_EXTRA_FILES
          add option BR2_TARGET_ROOTFS_ISO9660_OVERLAY
          modify code to include this new option
        modify comment
        modify signed-off-by (use real name)
        keep default option for BR2_TARGET_ROOTFS_ISO9660_ROCK_RIDGE
          in old code, it defined by default (keep for compatibility)
        modify default option for BR2_TARGET_ROOTFS_ISO9660_NAME
        modify default option for BR2_TARGET_ROOTFS_ISO9660_INPUT_CHARSET
        modify variable name to add prefix 'ISO9660_'
        "qstrip" each variable
          BR2_TARGET_ROOTFS_ISO9660_INPUT_CHARSET
          BR2_TARGET_ROOTFS_ISO9660_NAME
        modify command INITRD_SED_CMD
        modify kernel launch for this iso
          use LINUX_IMAGE_NAME
          add command sed to replace __LINUX_IMAGE_NAME__ in configuration


Signed-off-by: Jerome Sagnole <jean.sorgemoel@laposte.net>
---
 fs/iso9660/Config.in  |   49 ++++++++++++++++++++++++++++++++++-
 fs/iso9660/iso9660.mk |   68 ++++++++++++++++++++++++++++++++++++-------------
 2 files changed, 99 insertions(+), 18 deletions(-)

Comments

Thomas Petazzoni March 2, 2014, 4:17 p.m. UTC | #1
Hello,

On Sat,  1 Mar 2014 22:00:55 +0100, jean.sorgemoel@laposte.net wrote:
> From: Jerome Sagnole <jean.sorgemoel@laposte.net>
> 
> Changelog :
> 
> patch v1 : new branch to generate iso with bootloader isolinux
> 
> patch v2 : add bootloader option for iso9660 filesystem image (isolinux)
>         addon to include comment Arnout Vandecappelle
>         simplify code
>           1/ I suppress redundant comment
>           2/ Suppress menu and use conditional (replace 'depends on' by 'if/end$
>           3/ Modify comment
>           4/ suppress option (keyboard, ...)
>           5/ replace 8 x space by tabulation
>                 File : fs/isolinux/isolinux.mk
>           6/ suppress extension 'BR2_'
>           7/ use variable 'ISOLINUX_DIR'
>           8/ suppress keyboard option
>           9/ I can't use command '$(INSTALL) -D' beacause I don't define filena$
>          10/ Hide command genisoimage (with option $@)
> 
> patch v3 : add bootloader option for iso9660 filesystem image (isolinux)
>         addon to include comment Thomas Petazzoni & Arnout Vandecappelle
>         modify comment
>         default generate iso with grub bootloader
>         you can select isolinux bootloader
>         detail : (module fs/iso9660)
>           option to select bootloader (grub/isolinux)
>           file(s) bootloader configuration
>           option to copy file(s) on iso (only for isolinux)
>           option to create iso with long filenames (Joliet format)
>           option to create iso with POSIX file system (file mode, uid, gid, ...)
>           define volume label
>           define parameter input charset
>           can use initramfs (if activate), also cpio (like initrd)
> 
> patch v4 : add bootloader option for iso9660 filesystem image (isolinux)
>         addon to include comment Arnout Vandecappelle & Thomas Petazzoni
>         add choise to select bootloader in iso9660 menu
>         modify comment
>         seperate code in two patch
>           1st patch : update iso9660 with grub
>           2nd patch : add new bootloader isolinux
> 
> patch v5 part 1: modify bootloader option for iso9660 filesystem image (grub)
>         addon to include comment Arnout Vandecappelle & Martin Bark
>         modify option to include files and directories in iso image
>           suppress option BR2_TARGET_ROOTFS_ISOLINUX_EXTRA_FILES
>           add option BR2_TARGET_ROOTFS_ISO9660_OVERLAY
>           modify code to include this new option
>         modify comment
>         modify signed-off-by (use real name)
>         keep default option for BR2_TARGET_ROOTFS_ISO9660_ROCK_RIDGE
>           in old code, it defined by default (keep for compatibility)
>         modify default option for BR2_TARGET_ROOTFS_ISO9660_NAME
>         modify default option for BR2_TARGET_ROOTFS_ISO9660_INPUT_CHARSET
>         modify variable name to add prefix 'ISO9660_'
>         "qstrip" each variable
>           BR2_TARGET_ROOTFS_ISO9660_INPUT_CHARSET
>           BR2_TARGET_ROOTFS_ISO9660_NAME
>         modify command INITRD_SED_CMD
>         modify kernel launch for this iso
>           use LINUX_IMAGE_NAME
>           add command sed to replace __LINUX_IMAGE_NAME__ in configuration

This changelog should go after the "---" sign below. Moreover your
commit should have a proper title, like:

	fs/iso9660: <short description>

and a proper commit log, with several paragraphs explaining what the
commit is changing. Your title mentions only "modify bootloader
option", but your commit does *much* more than that. If your commit
does multiple things, it should be split into several commits. Your
commit actually seems to be doing several things:

 * Adding multiple new options for ISO9660 filesystems: Joliet,
   RockRidge, name, input charset, overlay, etc.

 * Adding the infrastructure to use different bootloaders.

Those two things should lead to two separate patches.

See also
http://buildroot.org/downloads/manual/manual.html#_patch_revision_changelog
on how to format a git commit log with a changelog.

> Signed-off-by: Jerome Sagnole <jean.sorgemoel@laposte.net>
> ---
>  fs/iso9660/Config.in  |   49 ++++++++++++++++++++++++++++++++++-
>  fs/iso9660/iso9660.mk |   68 ++++++++++++++++++++++++++++++++++++-------------
>  2 files changed, 99 insertions(+), 18 deletions(-)
> 
> diff --git a/fs/iso9660/Config.in b/fs/iso9660/Config.in
> index 50b4377..8020bd8 100644
> --- a/fs/iso9660/Config.in
> +++ b/fs/iso9660/Config.in
> @@ -8,10 +8,57 @@ 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"
> +	help
> +	  Grub configuration
> +	  Define menu, commands and options for grub
> +
> +config BR2_TARGET_ROOTFS_ISO9660_OVERLAY
> +	string "iso9660 filesystem overlay directories"
> +	default ""
> +	help
> +	  Specify a list of directories that are copied over the root of the
> +	  iso filesystem after the build has finished and before it is
> +	  packed into the iso filesystem image.
> +
> +	  They are copied as-is into the iso image, excluding files ending
> +	  with ~ and .git, .svn and .hg directories.

I must say I'm not a big fan of this. We already have an overlay
mechanism for the root filesystem. I understand that in the case of
iso9660, the root filesystem as generated by Buildroot goes into the
initramfs, and that there is no way to put some more stuff in the
iso9660 filesystem itself (outside the initramfs), I believe that the
direction we are taking here is the wrong one.

Instead, I believe we should turn the iso9660 option into what it
should have been in the first place: using an iso9660 root filesystem.
So we would get rid of the initramfs usage, enable Rock Ridge and
Joliet extensions by default, and put the Buildroot filesystem as is in
the ISO9660 filesystem. This way, no need for an additional overlay
mechanism, we can just re-use the one from Buildroot.

Do you think this would be possible?

Thanks,

Thomas
jean March 2, 2014, 7:04 p.m. UTC | #2
Hi,

On 02/03/2014 17:17, Thomas Petazzoni wrote:
> Hello,
>
> On Sat,  1 Mar 2014 22:00:55 +0100,jean.sorgemoel@laposte.net  wrote:
>> From: Jerome Sagnole<jean.sorgemoel@laposte.net>
>>
>> Changelog :
>>
>> patch v1 : new branch to generate iso with bootloader isolinux
>>
>> patch v2 : add bootloader option for iso9660 filesystem image (isolinux)
>>          addon to include comment Arnout Vandecappelle
>>          simplify code
>>            1/ I suppress redundant comment
>>            2/ Suppress menu and use conditional (replace 'depends on' by 'if/end$
>>            3/ Modify comment
>>            4/ suppress option (keyboard, ...)
>>            5/ replace 8 x space by tabulation
>>                  File : fs/isolinux/isolinux.mk
>>            6/ suppress extension 'BR2_'
>>            7/ use variable 'ISOLINUX_DIR'
>>            8/ suppress keyboard option
>>            9/ I can't use command '$(INSTALL) -D' beacause I don't define filena$
>>           10/ Hide command genisoimage (with option $@)
>>
>> patch v3 : add bootloader option for iso9660 filesystem image (isolinux)
>>          addon to include comment Thomas Petazzoni & Arnout Vandecappelle
>>          modify comment
>>          default generate iso with grub bootloader
>>          you can select isolinux bootloader
>>          detail : (module fs/iso9660)
>>            option to select bootloader (grub/isolinux)
>>            file(s) bootloader configuration
>>            option to copy file(s) on iso (only for isolinux)
>>            option to create iso with long filenames (Joliet format)
>>            option to create iso with POSIX file system (file mode, uid, gid, ...)
>>            define volume label
>>            define parameter input charset
>>            can use initramfs (if activate), also cpio (like initrd)
>>
>> patch v4 : add bootloader option for iso9660 filesystem image (isolinux)
>>          addon to include comment Arnout Vandecappelle & Thomas Petazzoni
>>          add choise to select bootloader in iso9660 menu
>>          modify comment
>>          seperate code in two patch
>>            1st patch : update iso9660 with grub
>>            2nd patch : add new bootloader isolinux
>>
>> patch v5 part 1: modify bootloader option for iso9660 filesystem image (grub)
>>          addon to include comment Arnout Vandecappelle & Martin Bark
>>          modify option to include files and directories in iso image
>>            suppress option BR2_TARGET_ROOTFS_ISOLINUX_EXTRA_FILES
>>            add option BR2_TARGET_ROOTFS_ISO9660_OVERLAY
>>            modify code to include this new option
>>          modify comment
>>          modify signed-off-by (use real name)
>>          keep default option for BR2_TARGET_ROOTFS_ISO9660_ROCK_RIDGE
>>            in old code, it defined by default (keep for compatibility)
>>          modify default option for BR2_TARGET_ROOTFS_ISO9660_NAME
>>          modify default option for BR2_TARGET_ROOTFS_ISO9660_INPUT_CHARSET
>>          modify variable name to add prefix 'ISO9660_'
>>          "qstrip" each variable
>>            BR2_TARGET_ROOTFS_ISO9660_INPUT_CHARSET
>>            BR2_TARGET_ROOTFS_ISO9660_NAME
>>          modify command INITRD_SED_CMD
>>          modify kernel launch for this iso
>>            use LINUX_IMAGE_NAME
>>            add command sed to replace __LINUX_IMAGE_NAME__ in configuration
> This changelog should go after the "---" sign below. Moreover your
> commit should have a proper title, like:
>
> 	fs/iso9660: <short description>
>
> and a proper commit log, with several paragraphs explaining what the
> commit is changing. Your title mentions only "modify bootloader
> option", but your commit does *much* more than that. If your commit
> does multiple things, it should be split into several commits. Your
> commit actually seems to be doing several things:
>
>   * Adding multiple new options for ISO9660 filesystems: Joliet,
>     RockRidge, name, input charset, overlay, etc.
>
>   * Adding the infrastructure to use different bootloaders.
>
> Those two things should lead to two separate patches.
>
> See also
> http://buildroot.org/downloads/manual/manual.html#_patch_revision_changelog
> on how to format a git commit log with a changelog.

Good remark, I will update my patch.

>> Signed-off-by: Jerome Sagnole<jean.sorgemoel@laposte.net>
>> ---
>>   fs/iso9660/Config.in  |   49 ++++++++++++++++++++++++++++++++++-
>>   fs/iso9660/iso9660.mk |   68 ++++++++++++++++++++++++++++++++++++-------------
>>   2 files changed, 99 insertions(+), 18 deletions(-)
>>
>> diff --git a/fs/iso9660/Config.in b/fs/iso9660/Config.in
>> index 50b4377..8020bd8 100644
>> --- a/fs/iso9660/Config.in
>> +++ b/fs/iso9660/Config.in
>> @@ -8,10 +8,57 @@ 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"
>> +	help
>> +	  Grub configuration
>> +	  Define menu, commands and options for grub
>> +
>> +config BR2_TARGET_ROOTFS_ISO9660_OVERLAY
>> +	string "iso9660 filesystem overlay directories"
>> +	default ""
>> +	help
>> +	  Specify a list of directories that are copied over the root of the
>> +	  iso filesystem after the build has finished and before it is
>> +	  packed into the iso filesystem image.
>> +
>> +	  They are copied as-is into the iso image, excluding files ending
>> +	  with ~ and .git, .svn and .hg directories.
> I must say I'm not a big fan of this. We already have an overlay
> mechanism for the root filesystem. I understand that in the case of
> iso9660, the root filesystem as generated by Buildroot goes into the
> initramfs, and that there is no way to put some more stuff in the
> iso9660 filesystem itself (outside the initramfs), I believe that the
> direction we are taking here is the wrong one.
>
> Instead, I believe we should turn the iso9660 option into what it
> should have been in the first place: using an iso9660 root filesystem.
> So we would get rid of the initramfs usage, enable Rock Ridge and
> Joliet extensions by default, and put the Buildroot filesystem as is in
> the ISO9660 filesystem. This way, no need for an additional overlay
> mechanism, we can just re-use the one from Buildroot.
>
> Do you think this would be possible?
The goal is to copy on iso the binary to choice in boot. (ex. check memory)
The initial code copy only files (not directories). (and without overlay 
method)
What's method can be use?

I will update my patch without this option.
I will enable Joliet extension by default (for Rock Ridge it's ok)

> Thanks,
>
> Thomas

Thanks,
Jerome
diff mbox

Patch

diff --git a/fs/iso9660/Config.in b/fs/iso9660/Config.in
index 50b4377..8020bd8 100644
--- a/fs/iso9660/Config.in
+++ b/fs/iso9660/Config.in
@@ -8,10 +8,57 @@  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"
+	help
+	  Grub configuration
+	  Define menu, commands and options for grub
+
+config BR2_TARGET_ROOTFS_ISO9660_OVERLAY
+	string "iso9660 filesystem overlay directories"
+	default ""
+	help
+	  Specify a list of directories that are copied over the root of the
+	  iso filesystem after the build has finished and before it is
+	  packed into the iso filesystem image.
+
+	  They are copied as-is into the iso image, excluding files ending
+	  with ~ and .git, .svn and .hg directories.
+
+config BR2_TARGET_ROOTFS_ISO9660_JOLIET
+	bool "Create iso with Joliet format (long filenames)"
+	help
+	  Generate iso image with Joliet directory records.
+	  Use Unicode and each path component can be up 64
+	  Unicode characters long.
+
+config BR2_TARGET_ROOTFS_ISO9660_ROCK_RIDGE
+	bool "Create iso with Rock Ridge extensions (POSIX filesystem)"
+	default y
+	help
+	  Generate iso image with Rock Ridge directory information,
+	  which makes it a POSIX filesystem (file mode, uid, gid, ...)
+
+config BR2_TARGET_ROOTFS_ISO9660_NAME
+	string "Volume label"
+	default ""
+	help
+	  cdrom name
+
+config BR2_TARGET_ROOTFS_ISO9660_INPUT_CHARSET
+	string "Input filename character encoding"
+	default "utf8"
+	help
+	  The character encoding with which the names of the files that
+	  will be copied into the iso9660 filesystem are encoded. For the
+	  RockRidge directory, the same encoding will be used. For the
+	  Joliet directory, it will be converted to UTF-16.
+	  (see program genisoimage : genisoimage -input-charset help)
+
+endif # BR2_TARGET_ROOTFS_ISO9660
 
 comment "iso image needs a Linux kernel to be built"
 	depends on BR2_i386 || BR2_x86_64
diff --git a/fs/iso9660/iso9660.mk b/fs/iso9660/iso9660.mk
index a6a9c95..fdba96c 100644
--- a/fs/iso9660/iso9660.mk
+++ b/fs/iso9660/iso9660.mk
@@ -9,33 +9,59 @@ 
 
 ISO9660_TARGET_DIR = $(BUILD_DIR)/iso9660
 ISO9660_BOOT_MENU := $(call qstrip,$(BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU))
+ISO9660_CHARSET = $(call qstrip,$(BR2_TARGET_ROOTFS_ISO9660_INPUT_CHARSET))
+ISO9660_NAME = $(call qstrip,$(BR2_TARGET_ROOTFS_ISO9660_NAME))
+ISO9660_KERNEL_DST = $(ISO9660_TARGET_DIR)/kernel
+
+ISO9660_BOOTLOADER_BIN = $(GRUB_DIR)/stage2/stage2_eltorito
+ISO9660_BOOTLOADER_DIR = $(ISO9660_TARGET_DIR)/boot/grub/
+ISO9660_BOOTLOADER_DST_CFG = $(ISO9660_TARGET_DIR)/boot/grub/menu.lst
+ISO9660_ELTORITO_BOOT = boot/grub/stage2_eltorito
 
 $(BINARIES_DIR)/rootfs.iso9660: host-cdrkit host-fakeroot linux rootfs-cpio grub
 	@$(call MESSAGE,"Generating root filesystem image rootfs.iso9660")
-	mkdir -p $(ISO9660_TARGET_DIR)
-	mkdir -p $(ISO9660_TARGET_DIR)/boot/grub
-	cp $(GRUB_DIR)/stage2/stage2_eltorito $(ISO9660_TARGET_DIR)/boot/grub/
-	cp $(ISO9660_BOOT_MENU) $(ISO9660_TARGET_DIR)/boot/grub/menu.lst
+	@mkdir -p $(ISO9660_TARGET_DIR)
+	@mkdir -p $(ISO9660_BOOTLOADER_DIR)
+
+	@cp $(ISO9660_BOOTLOADER_BIN) $(ISO9660_BOOTLOADER_DIR)
+	@cp $(ISO9660_BOOT_MENU) $(ISO9660_BOOTLOADER_DST_CFG)
+	@cp $(LINUX_IMAGE_PATH) $(ISO9660_KERNEL_DST)
+
 ifeq ($(BR2_TARGET_GRUB_SPLASH),)
-	$(SED) '/^splashimage/d' $(ISO9660_TARGET_DIR)/boot/grub/menu.lst
+	@$(SED) '/^splashimage/d' $(ISO9660_BOOTLOADER_DST_CFG)
 else
-	cp boot/grub/splash.xpm.gz $(ISO9660_TARGET_DIR)/
-endif
-	cp $(LINUX_IMAGE_PATH) $(ISO9660_TARGET_DIR)/kernel
+	@cp boot/grub/splash.xpm.gz $(ISO9660_TARGET_DIR)/
+endif # BR2_TARGET_GRUB_SPLASH
+
 ifeq ($(BR2_TARGET_ROOTFS_INITRAMFS),y)
-	$(SED) '/initrd/d'  $(ISO9660_TARGET_DIR)/boot/grub/menu.lst
+	@$(SED) '/initrd/d'  $(ISO9660_BOOTLOADER_DST_CFG)
 else
-	cp $(BINARIES_DIR)/rootfs.cpio$(ROOTFS_CPIO_COMPRESS_EXT) $(ISO9660_TARGET_DIR)/initrd
-endif
+	@cp $(BINARIES_DIR)/rootfs.cpio$(ROOTFS_CPIO_COMPRESS_EXT) \
+		$(ISO9660_TARGET_DIR)/initrd
+endif # BR2_TARGET_ROOTFS_INITRAMFS
+
+	@$(foreach d, $(call qstrip,$(BR2_TARGET_ROOTFS_ISO9660_OVERLAY)), \
+		$(call MESSAGE,"Copying overlay $(d)"); \
+		rsync -a --ignore-times $(RSYNC_VCS_EXCLUSIONS) \
+		      --chmod=Du+w --exclude .empty --exclude '*~' \
+		      $(d)/ $(ISO9660_TARGET_DIR)$(sep))
+
 	# Use fakeroot to pretend all target binaries are owned by root
-	rm -f $(FAKEROOT_SCRIPT)
-	echo "chown -R 0:0 $(ISO9660_TARGET_DIR)" >> $(FAKEROOT_SCRIPT)
+	@rm -f $(FAKEROOT_SCRIPT)
+	@echo "chown -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)" \
+	@echo "$(HOST_DIR)/usr/bin/genisoimage " \
+		"$(GENISOIMAGE_OPTS) " \
+		"-b $(ISO9660_ELTORITO_BOOT) " \
+		"-no-emul-boot " \
+		"-boot-load-size 4 " \
+		"-boot-info-table " \
+		"-input-charset '$(ISO9660_CHARSET)' " \
+		"-V '$(ISO9660_NAME)' " \
+		"-o $@ $(ISO9660_TARGET_DIR)" \
 		>> $(FAKEROOT_SCRIPT)
-	chmod a+x $(FAKEROOT_SCRIPT)
-	$(HOST_DIR)/usr/bin/fakeroot -- $(FAKEROOT_SCRIPT)
+	@chmod a+x $(FAKEROOT_SCRIPT)
+	@$(HOST_DIR)/usr/bin/fakeroot -- $(FAKEROOT_SCRIPT)
 	-@rm -f $(FAKEROOT_SCRIPT)
 	-@rm -rf $(ISO9660_TARGET_DIR)
 
@@ -49,3 +75,11 @@  rootfs-iso9660: $(BINARIES_DIR)/rootfs.iso9660
 ifeq ($(BR2_TARGET_ROOTFS_ISO9660),y)
 TARGETS += rootfs-iso9660
 endif
+
+ifeq ($(BR2_TARGET_ROOTFS_ISO9660_JOLIET),y)
+GENISOIMAGE_OPTS += -J
+endif
+
+ifeq ($(BR2_TARGET_ROOTFS_ISO9660_ROCK_RIDGE),y)
+GENISOIMAGE_OPTS += -R
+endif