summaryrefslogtreecommitdiffstats
path: root/include/image-commands.mk
diff options
context:
space:
mode:
authorDaniel Golle <daniel@makrotopia.org>2024-02-16 05:32:51 +0000
committerDaniel Golle <daniel@makrotopia.org>2024-02-16 05:32:51 +0000
commit67beab2b2b39c4fe3e48a021aefbfac15ffa70ce (patch)
treec9d7105936fec1b77d8de04b7abddc6e6ea40bd8 /include/image-commands.mk
parentdc0cf0fc509d7d2ae1250144d4615275094b943e (diff)
downloadopenwrt-67beab2b2b39c4fe3e48a021aefbfac15ffa70ce.tar.gz
openwrt-67beab2b2b39c4fe3e48a021aefbfac15ffa70ce.tar.bz2
openwrt-67beab2b2b39c4fe3e48a021aefbfac15ffa70ce.zip
scripts: ubinize-image.sh: fix on POSIX shell, allow custom images
Make sure ubinize-image.sh also works with more simple POSIX Shell and allow creating complete custom images to be used as ARTIFACT/foo.img and thereby allow including uImage.FIT, TF-A FIP and what ever else is required on a specific board. Fixes: 6c17d71973 ("scripts: ubinize-image.sh: support static volumes, make size optional") Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Diffstat (limited to 'include/image-commands.mk')
-rw-r--r--include/image-commands.mk18
1 files changed, 14 insertions, 4 deletions
diff --git a/include/image-commands.mk b/include/image-commands.mk
index 9ce97b17cf..8caeb1871c 100644
--- a/include/image-commands.mk
+++ b/include/image-commands.mk
@@ -138,11 +138,9 @@ UBI_NAND_SIZE_LIMIT = $(IMAGE_SIZE) - ($(NAND_SIZE)*20/1024 + 4*$(BLOCKSIZE))
define Build/append-ubi
sh $(TOPDIR)/scripts/ubinize-image.sh \
$(if $(UBOOTENV_IN_UBI),--uboot-env) \
- $(foreach part,$(UBINIZE_PARTS),--part $(part)) \
- $(if $(findstring fit,$(1)), \
- $(if $(KERNEL_IN_UBI),--part fit=$(IMAGE_KERNEL)), \
$(if $(KERNEL_IN_UBI),--kernel $(IMAGE_KERNEL)) \
- --rootfs $(IMAGE_ROOTFS)) \
+ $(foreach part,$(UBINIZE_PARTS),--part $(part)) \
+ --rootfs $(IMAGE_ROOTFS) \
$@.tmp \
-p $(BLOCKSIZE:%k=%KiB) -m $(PAGESIZE) \
$(if $(SUBPAGESIZE),-s $(SUBPAGESIZE)) \
@@ -154,6 +152,18 @@ define Build/append-ubi
$(call Build/check-size,$(UBI_NAND_SIZE_LIMIT)))
endef
+define Build/ubinize-image
+ sh $(TOPDIR)/scripts/ubinize-image.sh \
+ $(if $(UBOOTENV_IN_UBI),--uboot-env) \
+ $(foreach part,$(UBINIZE_PARTS),--part $(part)) \
+ --part $(word 1,$(1))="$(BIN_DIR)/$(DEVICE_IMG_PREFIX)-$(word 2,$(1))" \
+ $@ \
+ -p $(BLOCKSIZE:%k=%KiB) -m $(PAGESIZE) \
+ $(if $(SUBPAGESIZE),-s $(SUBPAGESIZE)) \
+ $(if $(VID_HDR_OFFSET),-O $(VID_HDR_OFFSET)) \
+ $(UBINIZE_OPTS)
+endef
+
define Build/ubinize-kernel
cp $@ $@.tmp
sh $(TOPDIR)/scripts/ubinize-image.sh \