mediatek: filogic: convert GL.iNet MT-6000 to NVMEM-on-MMC
[openwrt/staging/jow.git] / include / image-commands.mk
index 41a5e1198a95a098aef1ff6931f37ee917d721dc..79a64f4bc13997d8121b8167cea6b82a04c45611 100644 (file)
@@ -152,6 +152,20 @@ 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))" \
+               $@.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
        cp $@ $@.tmp
        sh $(TOPDIR)/scripts/ubinize-image.sh \