Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5d8217af authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Fix `m bootimage_test_harness` failure"

parents 56cc49ea f85e68f5
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -800,7 +800,7 @@ ifdef BOARD_BOOTIMAGE_PARTITION_SIZE
endif

# $1: boot image file name
# $2: boot image variant (boot, boot-debug)
# $2: boot image variant (boot, boot-debug, boot-test-harness)
define get-bootimage-partition-size
  $(BOARD_$(call to-upper,$(subst .img,,$(subst $(2),kernel,$(notdir $(1)))))_BOOTIMAGE_PARTITION_SIZE)
endef
@@ -2327,21 +2327,22 @@ endif
BOARD_AVB_BOOT_TEST_KEY_PATH := external/avb/test/data/testkey_rsa2048.pem
INTERNAL_AVB_BOOT_TEST_SIGNING_ARGS := --algorithm SHA256_RSA2048 --key $(BOARD_AVB_BOOT_TEST_KEY_PATH)
# $(1): the bootimage to sign
# $(2): boot image variant (boot, boot-debug, boot-test-harness)
define test-key-sign-bootimage
$(call assert-max-image-size,$(1),$(call get-hash-image-max-size,$(call get-bootimage-partition-size,$(1),boot-debug)))
$(call assert-max-image-size,$(1),$(call get-hash-image-max-size,$(call get-bootimage-partition-size,$(1),$(2))))
$(AVBTOOL) add_hash_footer \
  --image $(1) \
  --partition_size $(call get-bootimage-partition-size,$(1),boot-debug)\
  --partition_size $(call get-bootimage-partition-size,$(1),$(2))\
  --partition_name boot $(INTERNAL_AVB_BOOT_TEST_SIGNING_ARGS) \
  $(BOARD_AVB_BOOT_ADD_HASH_FOOTER_ARGS)
$(call assert-max-image-size,$(1),$(call get-bootimage-partition-size,$(1),boot-debug))
$(call assert-max-image-size,$(1),$(call get-bootimage-partition-size,$(1),$(2)))
endef

# $(1): output file
define build-debug-bootimage-target
  $(MKBOOTIMG) --kernel $(PRODUCT_OUT)/$(subst .img,,$(subst boot-debug,kernel,$(notdir $(1)))) \
    $(INTERNAL_DEBUG_BOOTIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $1
  $(if $(BOARD_AVB_BOOT_KEY_PATH),$(call test-key-sign-bootimage,$1))
  $(if $(BOARD_AVB_BOOT_KEY_PATH),$(call test-key-sign-bootimage,$1,boot-debug))
endef

# Depends on original boot.img and ramdisk-debug.img, to build the new boot-debug.img
@@ -2510,7 +2511,7 @@ endif
define build-boot-test-harness-target
  $(MKBOOTIMG) --kernel $(PRODUCT_OUT)/$(subst .img,,$(subst boot-test-harness,kernel,$(notdir $(1)))) \
    $(INTERNAL_TEST_HARNESS_BOOTIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $@
  $(if $(BOARD_AVB_BOOT_KEY_PATH),$(call test-key-sign-bootimage,$@))
  $(if $(BOARD_AVB_BOOT_KEY_PATH),$(call test-key-sign-bootimage,$@,boot-test-harness))
endef

# Build the new boot-test-harness.img, based on boot-debug.img and ramdisk-test-harness.img.