--rootfs $(call param_get_default,rootfs,$(1),$(IMAGE_ROOTFS)) \
$@
endef
+
+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)) \
+ "supported_devices":[$(call metadata_devices,$(1))], \
+ "version": { \
+ "dist": "$(call json_quote,$(VERSION_DIST))", \
+ "version": "$(call json_quote,$(VERSION_NUMBER))", \
+ "revision": "$(call json_quote,$(REVISION))", \
+ "board": "$(call json_quote,$(BOARD))" \
+ } \
+ }'
+
+define Build/append-metadata
+ $(if $(SUPPORTED_DEVICES),echo $(call metadata_json,$(SUPPORTED_DEVICES)) | fwtool -I - $@)
+endef
BOARD_NAME :=
UIMAGE_NAME :=
+ SUPPORTED_DEVICES :=
+ IMAGE_METADATA :=
FILESYSTEMS := $(TARGET_FILESYSTEMS)
endef
DEVICE_DTS DEVICE_DTS_DIR BOARD_NAME CMDLINE \
UBOOTENV_IN_UBI KERNEL_IN_UBI \
BLOCKSIZE PAGESIZE SUBPAGESIZE VID_HDR_OFFSET \
- UBINIZE_OPTS UIMAGE_NAME UBINIZE_PARTS
+ UBINIZE_OPTS UIMAGE_NAME UBINIZE_PARTS \
+ SUPPORTED_DEVICES IMAGE_METADATA
define Device/ExportVar
$(1) : $(2):=$$($(2))