build: image: add pad-to and pad-rootfs-squashfs helpers
[oweals/openwrt.git] / include / image-commands.mk
index c0bda2084c852098730782fce8148acf511f5c6f..06c084c48b0eeb54c15a69569dc84beaa8da8ff8 100644 (file)
@@ -230,8 +230,7 @@ define Build/append-uboot
 endef
 
 define Build/pad-to
-       dd if=$@ of=$@.new bs=$(1) conv=sync
-       mv $@.new $@
+       $(call Image/pad-to,$@,$(1))
 endef
 
 define Build/pad-extra
@@ -355,6 +354,7 @@ json_quote=$(subst ','\'',$(subst ",\",$(1)))
 metadata_devices=$(if $(1),$(subst "$(space)","$(comma)",$(strip $(foreach v,$(1),"$(call json_quote,$(v))"))))
 metadata_json = \
        '{ $(if $(IMAGE_METADATA),$(IMAGE_METADATA)$(comma)) \
+               "metadata_version": "1.0", \
                "supported_devices":[$(call metadata_devices,$(1))], \
                "version": { \
                        "dist": "$(call json_quote,$(VERSION_DIST))", \