From 939d37b88c15ed60896e183098c3fc8a53b7933e Mon Sep 17 00:00:00 2001 From: Seungjae Yoo Date: Mon, 18 Dec 2023 17:12:38 +0900 Subject: [PATCH] Append root digest information of microdroid vendor into vendor.img Instead appending public key information into vendor partition, append root digest of microdroid-vendor's hashtree descriptor. The root digest would be extracted in build time with avbtool. Bug: 285855436 Test: avbtool info_image --image $ANDROID_PRODUCT_OUT/vendor/etc/avf/microdroid/microdroid_vendor.img Test: avbtool info_image --image $ANDROID_PRODUCT_OUT/vendor.img Change-Id: I930b09774a1024a2e5d30f474f1589fc1b8aa25a --- core/Makefile | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/core/Makefile b/core/Makefile index 3f0da8bdf1..6edac1ab0a 100644 --- a/core/Makefile +++ b/core/Makefile @@ -4600,10 +4600,18 @@ BOARD_AVB_PVMFW_ADD_HASH_FOOTER_ARGS += \ --prop com.android.build.pvmfw.security_patch:$(PVMFW_SECURITY_PATCH) endif -# Append avbpubkey of microdroid-vendor partition into vendor_boot partition. -ifdef MICRODROID_VENDOR_AVBKEY -BOARD_AVB_VENDOR_BOOT_ADD_HASH_FOOTER_ARGS += \ - --prop_from_file com.android.build.microdroid-vendor.avbpubkey:$(MICRODROID_VENDOR_AVBKEY) +# Append root digest of microdroid-vendor partition's hashtree descriptor into vendor partition. +ifdef MICRODROID_VENDOR_IMAGE_MODULE +MICRODROID_VENDOR_IMAGE := \ + $(call intermediates-dir-for,ETC,$(MICRODROID_VENDOR_IMAGE_MODULE))/$(MICRODROID_VENDOR_IMAGE_MODULE) +MICRODROID_VENDOR_ROOT_DIGEST := $(PRODUCT_OUT)/microdroid_vendor_root_digest +BOARD_AVB_VENDOR_ADD_HASHTREE_FOOTER_ARGS += \ + --prop_from_file com.android.build.microdroid-vendor.root_digest:$(MICRODROID_VENDOR_ROOT_DIGEST) +$(MICRODROID_VENDOR_ROOT_DIGEST): $(AVBTOOL) $(MICRODROID_VENDOR_IMAGE) + $(AVBTOOL) print_partition_digests \ + --image $(MICRODROID_VENDOR_IMAGE) \ + | tr -d '\n' | sed -E 's/.*: //g' > $@ +$(INSTALLED_VENDORIMAGE_TARGET): $(MICRODROID_VENDOR_ROOT_DIGEST) endif BOOT_FOOTER_ARGS := BOARD_AVB_BOOT_ADD_HASH_FOOTER_ARGS