From dae462bdd19dd18e58f082531ccf22f62eb52835 Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Wed, 24 May 2017 15:41:53 -0700 Subject: [PATCH 1/2] Accept multiple input files for device manifest. Test: test with DEVICE_MANIFEST_FILE variable split into multiple files Bug: 38217107 Change-Id: I1146898e4ccf0e8bac7d8541032f160476dbc148 Merged-In: I1146898e4ccf0e8bac7d8541032f160476dbc148 --- target/board/Android.mk | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/target/board/Android.mk b/target/board/Android.mk index 4c804e0ed5..dcb029648d 100644 --- a/target/board/Android.mk +++ b/target/board/Android.mk @@ -32,14 +32,18 @@ endif # Device Manifest ifdef DEVICE_MANIFEST_FILE +# $(DEVICE_MANIFEST_FILE) can be a list of files include $(CLEAR_VARS) LOCAL_MODULE := manifest.xml LOCAL_MODULE_CLASS := ETC LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR) GEN := $(local-generated-sources-dir)/manifest.xml +$(GEN): PRIVATE_DEVICE_MANIFEST_FILE := $(DEVICE_MANIFEST_FILE) $(GEN): $(DEVICE_MANIFEST_FILE) $(HOST_OUT_EXECUTABLES)/assemble_vintf - BOARD_SEPOLICY_VERS=$(BOARD_SEPOLICY_VERS) $(HOST_OUT_EXECUTABLES)/assemble_vintf -i $< -o $@ + BOARD_SEPOLICY_VERS=$(BOARD_SEPOLICY_VERS) \ + $(HOST_OUT_EXECUTABLES)/assemble_vintf -o $@ \ + -i $(call normalize-path-list,$(PRIVATE_DEVICE_MANIFEST_FILE)) LOCAL_PREBUILT_MODULE_FILE := $(GEN) include $(BUILD_PREBUILT) From eb7b438994fdc3d60733f0a5cc4cce1c91136456 Mon Sep 17 00:00:00 2001 From: Bowgo Tsai Date: Fri, 19 May 2017 12:39:07 +0800 Subject: [PATCH 2/2] Pass FRAMEWORK_VBMETA_VERSION to assemble_vintf Note that this depends on a change in avbtool: https://android-review.googlesource.com/#/c/406374/ Bug: 38325029 Test: builds system.img, checks $OUT/system/compatibility_matrix.xml contains correct vbmeta-version Change-Id: Iacc0a2687fb39600ad6b8e9cfbfe5c1a3b90b40b Merged-In: Iacc0a2687fb39600ad6b8e9cfbfe5c1a3b90b40b --- target/board/Android.mk | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/target/board/Android.mk b/target/board/Android.mk index dcb029648d..e23ab214d2 100644 --- a/target/board/Android.mk +++ b/target/board/Android.mk @@ -114,9 +114,28 @@ $(GEN): PRIVATE_FLAGS := -c "$(BUILT_VENDOR_MANIFEST)" endif endif +ifeq (true,$(BOARD_AVB_ENABLE)) +$(GEN): $(AVBTOOL) +# INTERNAL_AVB_SYSTEM_SIGNING_ARGS consists of BOARD_AVB_SYSTEM_KEY_PATH and +# BOARD_AVB_SYSTEM_ALGORITHM. We should add the dependency of key path, which +# is a file, here. +$(GEN): $(BOARD_AVB_SYSTEM_KEY_PATH) +# Use deferred assignment (=) instead of immediate assignment (:=). +# Otherwise, cannot get INTERNAL_AVB_SYSTEM_SIGNING_ARGS. +FRAMEWORK_VBMETA_VERSION = $$("$(AVBTOOL)" add_hashtree_footer \ + --print_required_libavb_version \ + $(INTERNAL_AVB_SYSTEM_SIGNING_ARGS) \ + $(BOARD_AVB_SYSTEM_ADD_HASHTREE_FOOTER_ARGS)) +else +FRAMEWORK_VBMETA_VERSION := 0.0 +endif + $(GEN): $(FRAMEWORK_COMPATIBILITY_MATRIX_FILE) $(HOST_OUT_EXECUTABLES)/assemble_vintf # TODO(b/37405869) (b/37715375) inject avb versions as well for devices that have avb enabled. - POLICYVERS=$(POLICYVERS) BOARD_SEPOLICY_VERS=$(BOARD_SEPOLICY_VERS) $(HOST_OUT_EXECUTABLES)/assemble_vintf -i $< -o $@ $(PRIVATE_FLAGS) + POLICYVERS=$(POLICYVERS) \ + BOARD_SEPOLICY_VERS=$(BOARD_SEPOLICY_VERS) \ + FRAMEWORK_VBMETA_VERSION=$(FRAMEWORK_VBMETA_VERSION) \ + $(HOST_OUT_EXECUTABLES)/assemble_vintf -i $< -o $@ $(PRIVATE_FLAGS) LOCAL_PREBUILT_MODULE_FILE := $(GEN) include $(BUILD_PREBUILT) BUILT_SYSTEM_COMPATIBILITY_MATRIX := $(LOCAL_BUILT_MODULE)