kernel: Allow passing empty DTB to mkbootimg via board-flag

* Boot Image header v2 demands a DTB be passed by default.
* We don't /need/ one at all, as we have and use a dedicated
  DTB partition.
* Signing hates trying to find dtb.img anywhere for some magical
  reason, so cheat and introduce a flag to include a blank one.

Change-Id: I889ce3815476a55829870b30de1b9210283a79ae
(cherry picked from commit fa16b42ddd1eb341f201b8d810c717ea12afe1cb)
This commit is contained in:
Luca Stefani
2022-09-12 17:55:12 -04:00
committed by Nolen Johnson
parent 26ddee9327
commit a1af8cb166

View File

@@ -496,12 +496,18 @@ $(DTB_OUT):
mkdir -p $(DTB_OUT)
$(INSTALLED_DTBIMAGE_TARGET): $(DTC) $(DTB_OUT)
ifeq ($(TARGET_WANTS_EMPTY_DTB),true)
@rm -f $@
echo "empty" > $@
else
@echo "Building dtb.img"
$(hide) find $(DTB_OUT)/arch/$(KERNEL_ARCH)/boot/dts -type f -name "*.dtb" | xargs rm -f
$(call make-dtb-target,$(KERNEL_DEFCONFIG))
$(call make-dtb-target,$(TARGET_KERNEL_DTB))
cat $(shell find $(DTB_OUT)/arch/$(KERNEL_ARCH)/boot/dts -type f -name "*.dtb" | sort) > $@
$(hide) touch -c $(DTB_OUT)
endif # !TARGET_WANTS_EMPTY_DTB
endif # !BOARD_PREBUILT_DTBIMAGE_DIR
endif # BOARD_INCLUDE_DTB_IN_BOOTIMG