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)
diff --git a/build/tasks/kernel.mk b/build/tasks/kernel.mk
index 68775c3..482defc 100644
--- a/build/tasks/kernel.mk
+++ b/build/tasks/kernel.mk
@@ -501,12 +501,18 @@
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