images: append to existing image with ubinize-image build cmd
authorDaniel Golle <daniel@makrotopia.org>
Fri, 16 Feb 2024 13:55:12 +0000 (13:55 +0000)
committerDaniel Golle <daniel@makrotopia.org>
Fri, 16 Feb 2024 13:56:01 +0000 (13:56 +0000)
Let ubinize-image append the ubinized image to the existing image
instead of replacing it.

Fixes: 6c17d71973 ("scripts: ubinize-image.sh: support static volumes, make size optional")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
include/image-commands.mk

index 8caeb1871c2cb268f47046aea841f6e6c14192fd..79a64f4bc13997d8121b8167cea6b82a04c45611 100644 (file)
@@ -157,11 +157,13 @@ define Build/ubinize-image
                $(if $(UBOOTENV_IN_UBI),--uboot-env) \
                $(foreach part,$(UBINIZE_PARTS),--part $(part)) \
                --part $(word 1,$(1))="$(BIN_DIR)/$(DEVICE_IMG_PREFIX)-$(word 2,$(1))" \
-               $@ \
+               $@.tmp \
                -p $(BLOCKSIZE:%k=%KiB) -m $(PAGESIZE) \
                $(if $(SUBPAGESIZE),-s $(SUBPAGESIZE)) \
                $(if $(VID_HDR_OFFSET),-O $(VID_HDR_OFFSET)) \
                $(UBINIZE_OPTS)
+       cat $@.tmp >> $@
+       rm $@.tmp
 endef
 
 define Build/ubinize-kernel