build: add additional parameter support to Build/jffs2
authorINAGAKI Hiroshi <musashino.open@gmail.com>
Mon, 13 Jan 2025 08:30:26 +0000 (17:30 +0900)
committerSander Vanheule <sander@svanheule.net>
Tue, 21 Jan 2025 17:37:51 +0000 (18:37 +0100)
Allow specifying additional parameters on Build/jffs2.
This is useful to specify additional options or overriding existing
ones.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/17593
Signed-off-by: Sander Vanheule <sander@svanheule.net>
include/image-commands.mk

index aa48e19399ecd8afed62d4a82f42145dccb2d312..030cd17dd868a6e3dafaa6ab6304b801df2a2ccb 100644 (file)
@@ -438,13 +438,14 @@ endef
 
 define Build/jffs2
        rm -rf $(KDIR_TMP)/$(DEVICE_NAME)/jffs2 && \
-               mkdir -p $(KDIR_TMP)/$(DEVICE_NAME)/jffs2/$$(dirname $(1)) && \
-               cp $@ $(KDIR_TMP)/$(DEVICE_NAME)/jffs2/$(1) && \
+               mkdir -p $(KDIR_TMP)/$(DEVICE_NAME)/jffs2/$$(dirname $(word 1,$(1))) && \
+               cp $@ $(KDIR_TMP)/$(DEVICE_NAME)/jffs2/$(word 1,$(1)) && \
                $(STAGING_DIR_HOST)/bin/mkfs.jffs2 --pad \
                        $(if $(CONFIG_BIG_ENDIAN),--big-endian,--little-endian) \
                        --squash-uids -v -e $(patsubst %k,%KiB,$(BLOCKSIZE)) \
                        -o $@.new \
                        -d $(KDIR_TMP)/$(DEVICE_NAME)/jffs2 \
+                       $(wordlist 2,$(words $(1)),$(1)) \
                        2>&1 1>/dev/null | awk '/^.+$$$$/' && \
                $(STAGING_DIR_HOST)/bin/padjffs2 $@.new -J $(patsubst %k,,$(BLOCKSIZE))
        -rm -rf $(KDIR_TMP)/$(DEVICE_NAME)/jffs2/