blob: dc3a98ac79cb7c447a1502bcecff79a46972daaa [file] [log] [blame]
Luca Stefanid9347002018-07-12 17:23:54 +02001ifneq ($(TARGET_NO_KERNEL),true)
2ifeq ($(strip $(BOARD_KERNEL_SEPARATED_DTBO)),true)
3
4MKDTIMG := $(HOST_OUT_EXECUTABLES)/mkdtimg$(HOST_EXECUTABLE_SUFFIX)
5
6INSTALLED_DTBOIMAGE_TARGET := $(PRODUCT_OUT)/dtbo.img
7
8# Most specific paths must come first in possible_dtbo_dirs
9possible_dtbo_dirs = $(KERNEL_OUT)/arch/$(KERNEL_ARCH)/boot/dts $(KERNEL_OUT)/arch/arm/boot/dts
10
11define build-dtboimage-target
12 $(call pretty,"Target dtbo image: $(INSTALLED_DTBOIMAGE_TARGET)")
13 $(hide) for dir in $(possible_dtbo_dirs); do \
14 if [ -d "$$dir" ]; then \
15 dtbo_dir="$$dir"; \
16 break; \
17 fi; \
18 done; \
19 $(MKDTIMG) create $@ --page_size=$(BOARD_KERNEL_PAGESIZE) $$(find "$$dtbo_dir" -name '*.dtbo')
20 $(hide) chmod a+r $@
21endef
22
23ifeq ($(BOARD_AVB_ENABLE),true)
24$(INSTALLED_DTBOIMAGE_TARGET): $(AVBTOOL) $(BOARD_AVB_DTBO_KEY_PATH) $(MKDTIMG) $(INSTALLED_KERNEL_TARGET)
25 $(build-dtboimage-target)
26 $(AVBTOOL) add_hash_footer \
27 --image $@ \
28 --partition_size $(BOARD_DTBOIMG_PARTITION_SIZE) \
29 --partition_name dtbo $(INTERNAL_AVB_DTBO_SIGNING_ARGS) \
30 $(BOARD_AVB_DTBO_ADD_HASH_FOOTER_ARGS)
31else
32$(INSTALLED_DTBOIMAGE_TARGET): $(MKDTIMG) $(INSTALLED_KERNEL_TARGET)
33 $(build-dtboimage-target)
34endif
35
36endif # BOARD_KERNEL_SEPARATED_DTBO
37endif # TARGET_NO_KERNEL