lineage: Rework DTBO image generation
Currently we handle the DTBO images from start to finish, including
AVB footers, and just drop them in $(PRODUCT_OUT)/dtbo.img when done.
While this works for the most part, we are limited in what we can do
with the DTBO images. For example non-A/B device recovery images must
have a copy of the DTBO image appended to recovery (see AOSP docs:
https://source.android.com/devices/bootloader/recovery-image ). This
means that we need to pass the pre-AVB dtbo image into
BOARD_PREBUILT_DTBOIMAGE in order to let the AOSP build system handle it.
This commit reworks the way the DTBO images are built, placing them at
$(PRODUCT_OUT)/dtbo-pre.img instead and setting BOARD_PREBUILT_DTBOIMAGE
to that path so the AOSP build system can pick the images up and sign
them and append to recovery (for applicable devices).
Change-Id: I8819d7cd92ba298de67dbc7f6b321917ba8524f1
diff --git a/build/tasks/dtbo.mk b/build/tasks/dtbo.mk
index dc3a98a..674eae0 100644
--- a/build/tasks/dtbo.mk
+++ b/build/tasks/dtbo.mk
@@ -3,13 +3,13 @@
MKDTIMG := $(HOST_OUT_EXECUTABLES)/mkdtimg$(HOST_EXECUTABLE_SUFFIX)
-INSTALLED_DTBOIMAGE_TARGET := $(PRODUCT_OUT)/dtbo.img
+BOARD_PREBUILT_DTBOIMAGE := $(PRODUCT_OUT)/dtbo-pre.img
# Most specific paths must come first in possible_dtbo_dirs
possible_dtbo_dirs = $(KERNEL_OUT)/arch/$(KERNEL_ARCH)/boot/dts $(KERNEL_OUT)/arch/arm/boot/dts
define build-dtboimage-target
- $(call pretty,"Target dtbo image: $(INSTALLED_DTBOIMAGE_TARGET)")
+ $(call pretty,"Target dtbo image: $(BOARD_PREBUILT_DTBOIMAGE)")
$(hide) for dir in $(possible_dtbo_dirs); do \
if [ -d "$$dir" ]; then \
dtbo_dir="$$dir"; \
@@ -20,18 +20,8 @@
$(hide) chmod a+r $@
endef
-ifeq ($(BOARD_AVB_ENABLE),true)
-$(INSTALLED_DTBOIMAGE_TARGET): $(AVBTOOL) $(BOARD_AVB_DTBO_KEY_PATH) $(MKDTIMG) $(INSTALLED_KERNEL_TARGET)
+$(BOARD_PREBUILT_DTBOIMAGE): $(MKDTIMG) $(INSTALLED_KERNEL_TARGET)
$(build-dtboimage-target)
- $(AVBTOOL) add_hash_footer \
- --image $@ \
- --partition_size $(BOARD_DTBOIMG_PARTITION_SIZE) \
- --partition_name dtbo $(INTERNAL_AVB_DTBO_SIGNING_ARGS) \
- $(BOARD_AVB_DTBO_ADD_HASH_FOOTER_ARGS)
-else
-$(INSTALLED_DTBOIMAGE_TARGET): $(MKDTIMG) $(INSTALLED_KERNEL_TARGET)
- $(build-dtboimage-target)
-endif
endif # BOARD_KERNEL_SEPARATED_DTBO
endif # TARGET_NO_KERNEL