scripts: ubinize-image.sh: support static volumes, make size optional
[openwrt/staging/wigyori.git] / include / image-commands.mk
index 41a5e1198a95a098aef1ff6931f37ee917d721dc..9ce97b17cfa4ccd5adb979e41162733dc9949433 100644 (file)
@@ -138,9 +138,11 @@ 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) \
-               $(if $(KERNEL_IN_UBI),--kernel $(IMAGE_KERNEL)) \
                $(foreach part,$(UBINIZE_PARTS),--part $(part)) \
-               --rootfs $(IMAGE_ROOTFS) \
+               $(if $(findstring fit,$(1)), \
+               $(if $(KERNEL_IN_UBI),--part fit=$(IMAGE_KERNEL)), \
+               $(if $(KERNEL_IN_UBI),--kernel $(IMAGE_KERNEL)) \
+               --rootfs $(IMAGE_ROOTFS)) \
                $@.tmp \
                -p $(BLOCKSIZE:%k=%KiB) -m $(PAGESIZE) \
                $(if $(SUBPAGESIZE),-s $(SUBPAGESIZE)) \