optional cross-check between OTA radio images and board-info.txt

Adds a python script which checks the version of each radio image
added with the new add-radio-file-checked macro against a file
containing sha-1 -> version string mappings and the contents of
board-info.txt, so that the build can fail if board-info.txt and the
OTA images are out of sync.

Change-Id: Icb61dc2adefc240ced9059941582c23b629089c0
diff --git a/core/definitions.mk b/core/definitions.mk
index 4f13133..0b7092f 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -1927,6 +1927,21 @@
 	$$(transform-prebuilt-to-target)
 endef
 
+# Version of add-radio-file that also arranges for the version of the
+# file to be checked against the contents of
+# $(TARGET_BOARD_INFO_FILE).
+# $(1): filename
+# $(2): name of version variable in board-info (eg, "version-baseband")
+define add-radio-file-checked
+  $(eval $(call add-radio-file-checked-internal,$(1),$(notdir $(1)),$(2)))
+endef
+define add-radio-file-checked-internal
+INSTALLED_RADIOIMAGE_TARGET += $$(PRODUCT_OUT)/$(2)
+BOARD_INFO_CHECK += $(3):$(LOCAL_PATH)/$(1)
+$$(PRODUCT_OUT)/$(2) : $$(LOCAL_PATH)/$(1) | $$(ACP)
+	$$(transform-prebuilt-to-target)
+endef
+
 
 ###########################################################
 # Override the package defined in $(1), setting the