AVB: support BOARD_BUILD_SYSTEM_ROOT_IMAGE

Passing --setup_rootfs_from_kernel to avbtool when
BOARD_BUILD_SYSTEM_ROOT_IMAGE is true

Bug: 33590159
Test: 'make' sailfish with BOARD_AVB_ENABLE := true
Test: 'make dist' with BOARD_AVB_ENABLE := true
Change-Id: Ieb58dd9ae6be1eceb90a33c739b85cff5cbc6e0a
This commit is contained in:
Bowgo Tsai 2017-04-14 18:50:11 +08:00
parent 8ee4a3db8c
commit 9b3776017f
2 changed files with 7 additions and 3 deletions

View file

@ -1698,13 +1698,16 @@ BUILT_VBMETAIMAGE_TARGET := $(PRODUCT_OUT)/vbmeta.img
INTERNAL_AVB_MAKE_VBMETA_IMAGE_ARGS := \
--include_descriptors_from_image $(INSTALLED_BOOTIMAGE_TARGET) \
--include_descriptors_from_image $(INSTALLED_SYSTEMIMAGE) \
--generate_dm_verity_cmdline_from_hashtree $(INSTALLED_SYSTEMIMAGE)
ifdef INSTALLED_VENDORIMAGE_TARGET
INTERNAL_AVB_MAKE_VBMETA_IMAGE_ARGS += \
--include_descriptors_from_image $(INSTALLED_VENDORIMAGE_TARGET)
endif
ifeq ($(BOARD_BUILD_SYSTEM_ROOT_IMAGE),true)
INTERNAL_AVB_MAKE_VBMETA_IMAGE_ARGS += --setup_rootfs_from_kernel $(BUILT_SYSTEMIMAGE)
endif
ifdef BOARD_AVB_ROLLBACK_INDEX
INTERNAL_AVB_MAKE_VBMETA_IMAGE_ARGS += --rollback_index $(BOARD_AVB_ROLLBACK_INDEX)
endif

View file

@ -293,10 +293,11 @@ def AddVBMeta(output_zip, boot_img_path, system_img_path, vendor_img_path,
cmd = [avbtool, "make_vbmeta_image",
"--output", img.name,
"--include_descriptors_from_image", boot_img_path,
"--include_descriptors_from_image", system_img_path,
"--generate_dm_verity_cmdline_from_hashtree", system_img_path]
"--include_descriptors_from_image", system_img_path]
if vendor_img_path is not None:
cmd.extend(["--include_descriptors_from_image", vendor_img_path])
if OPTIONS.info_dict.get("system_root_image", None) == "true":
cmd.extend(["--setup_rootfs_from_kernel", system_img_path])
common.AppendAVBSigningArgs(cmd)
args = OPTIONS.info_dict.get("board_avb_make_vbmeta_image_args", None)
if args and args.strip():