Skip to contentSkip to conversation

fs/iso9660: add specified files to image

PATCH New Alexey Lukyanchuk 2 participants 2 messages May 19, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 fs/iso9660: add specified files to image

Allows to add any specified files to iso-image

---
 fs/iso9660/Config.in  |  5 +++++
 fs/iso9660/iso9660.mk | 12 ++++++++++++
 2 files changed, 17 insertions(+)
fs/iso9660/Config.in +5 -0
index 6f001c0640..588fc307a5 100644
@@ -81,6 +81,11 @@ config BR2_TARGET_ROOTFS_ISO9660_HYBRID
 	  which BIOS considers a hard disk or ZIP disk, e.g. a USB key
 	  or similar.
 
+config BR2_ROOTFS_ISO9660_ADDITIONAL_FILES
+	string "Add additional files to iso"
+	help
+	  Use this option to add any additional files to iso
+
 endif
 
 comment "iso image needs a Linux kernel and either grub2 i386-pc or isolinux to be built"
fs/iso9660/iso9660.mk +12 -0
index a129655ce3..809f883be7 100644
@@ -23,6 +23,7 @@
 #     of BR2_TARGET_ROOTFS_ISO9660_INITRD).
 
 ROOTFS_ISO9660_BOOT_MENU = $(call qstrip,$(BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU))
+ROOTFS_ISO9660_ADDITIONAL_FILES=$(call qstrip,$(BR2_ROOTFS_ISO9660_ADDITIONAL_FILES))
 
 ROOTFS_ISO9660_DEPENDENCIES = host-cdrkit linux
 
@@ -143,4 +144,15 @@ endef
 ROOTFS_ISO9660_POST_GEN_HOOKS += ROOTFS_ISO9660_GEN_HYBRID
 endif
 
+define ROOTFS_ISO9660_ADD_ADDITIONAL_FILES
+	for i in $(ROOTFS_ISO9660_ADDITIONAL_FILES); do
+		$(INSTALL) -D -m 0755 $${i} \
+			$(ROOTFS_ISO9660_TMP_TARGET_DIR)/
+	done
+endef
+
+ifneq ($(ROOTFS_ISO9660_ADDITIONAL_FILES),)
+ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_ADD_ADDITIONAL_FILES
+endif
+
 $(eval $(rootfs))
Signature · 1 line
2.20.1
#1 lore raw

PATCH 2/2 fs/iso9660: add specified files to image

Alexey, All,

On 2019-05-19 14:36 +0300, Alexey Lukyanchuk spake thusly:

Quoted 1 line

Allows to add any specified files to iso-image

Same as for the grub2 patch: what are you trying to achieve with this patch?

Quoted 27 lines
---
 fs/iso9660/Config.in  |  5 +++++
 fs/iso9660/iso9660.mk | 12 ++++++++++++
 2 files changed, 17 insertions(+)
fs/iso9660/Config.in +5 -0
index 6f001c0640..588fc307a5 100644
@@ -81,6 +81,11 @@ config BR2_TARGET_ROOTFS_ISO9660_HYBRID
 	  which BIOS considers a hard disk or ZIP disk, e.g. a USB key
 	  or similar.
 
+config BR2_ROOTFS_ISO9660_ADDITIONAL_FILES
+	string "Add additional files to iso"
+	help
+	  Use this option to add any additional files to iso
+
 endif
 
 comment "iso image needs a Linux kernel and either grub2 i386-pc or isolinux to be built"
fs/iso9660/iso9660.mk +0 -0
index a129655ce3..809f883be7 100644

fs/iso9660/iso9660.mk line 26

Quoted 4 lines
fs/iso9660/iso9660.mk +1 -0
@@ -23,6 +23,7 @@
 #     of BR2_TARGET_ROOTFS_ISO9660_INITRD).
 
 ROOTFS_ISO9660_BOOT_MENU = $(call qstrip,$(BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU))
+ROOTFS_ISO9660_ADDITIONAL_FILES=$(call qstrip,$(BR2_ROOTFS_ISO9660_ADDITIONAL_FILES))

Please keep the coding style consistent, and use spaces around the equal sign, like the line just above.

fs/iso9660/iso9660.mk endef · line 151

Quoted 11 lines
fs/iso9660/iso9660.mk +5 -0
 ROOTFS_ISO9660_DEPENDENCIES = host-cdrkit linux
 
@@ -143,4 +144,15 @@ endef
 ROOTFS_ISO9660_POST_GEN_HOOKS += ROOTFS_ISO9660_GEN_HYBRID
 endif
 
+define ROOTFS_ISO9660_ADD_ADDITIONAL_FILES
+	for i in $(ROOTFS_ISO9660_ADDITIONAL_FILES); do
+		$(INSTALL) -D -m 0755 $${i} \
+			$(ROOTFS_ISO9660_TMP_TARGET_DIR)/
+	done

Does this even works? The lines are missing continuation '\', so make will try to run three commands:

1. for i in $(ROOTFS_ISO9660_ADDITIONAL_FILES); do
2. (INSTALL) -D -m 0755 $${i} $(ROOTFS_ISO9660_TMP_TARGET_DIR)/
3. done

Of course, the first is incomplete, so make will barf on it.

fs/iso9660/iso9660.mk endef · line 155

Quoted 4 lines
fs/iso9660/iso9660.mk +4 -0
+endef
+
+ifneq ($(ROOTFS_ISO9660_ADDITIONAL_FILES),)
+ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_ADD_ADDITIONAL_FILES

Kepp the hook definition and assignment in the conditional block, like is done for ROOTFS_ISO9660_GEN_HYBRID, just above.

Regards,
Yann E. MORIN.

Quoted 10 lines
fs/iso9660/iso9660.mk +2 -0
+endif
+
 $(eval $(rootfs))
Signature · 6 lines
2.20.1

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'