octeon: use new ext4/f2fs overlay support
[openwrt/openwrt.git] / include / image-commands.mk
index 00cb3410e95631a7808b8a624d0ee32f0445907c..7ff4c217a345e10a2a399e56fa45bc4ff3644209 100644 (file)
@@ -114,9 +114,10 @@ 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)) \
                $(IMAGE_ROOTFS) \
                $@.tmp \
-               -p $(BLOCKSIZE) -m $(PAGESIZE) \
+               -p $(BLOCKSIZE:%k=%KiB) -m $(PAGESIZE) \
                $(if $(SUBPAGESIZE),-s $(SUBPAGESIZE)) \
                $(if $(VID_HDR_OFFSET),-O $(VID_HDR_OFFSET)) \
                $(UBINIZE_OPTS)
@@ -129,15 +130,20 @@ define Build/pad-to
        mv $@.new $@
 endef
 
+define Build/pad-extra
+       dd if=/dev/zero bs=$(1) count=1 >> $@
+endef
+
 define Build/pad-rootfs
-       $(STAGING_DIR_HOST)/bin/padjffs2 $@ $(1) 4 8 16 64 128 256
+       $(STAGING_DIR_HOST)/bin/padjffs2 $@ $(1) \
+               $(if $(BLOCKSIZE),$(BLOCKSIZE:%k=%),4 8 16 64 128 256)
 endef
 
 define Build/pad-offset
        let \
                size="$$(stat -c%s $@)" \
-               pad="$(word 1, $(1))" \
-               offset="$(word 2, $(1))" \
+               pad="$(subst k,* 1024,$(word 1, $(1)))" \
+               offset="$(subst k,* 1024,$(word 2, $(1)))" \
                pad="(pad - ((size + offset) % pad)) % pad" \
                newsize='size + pad'; \
                dd if=$@ of=$@.new bs=$$newsize count=1 conv=sync