blob: 674eae0aa1c1144705874223d82bb542b9a84fd0 [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
Rashed Abdel-Tawab60fe9352019-05-16 14:01:19 -07006BOARD_PREBUILT_DTBOIMAGE := $(PRODUCT_OUT)/dtbo-pre.img
Luca Stefanid9347002018-07-12 17:23:54 +02007
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
Rashed Abdel-Tawab60fe9352019-05-16 14:01:19 -070012 $(call pretty,"Target dtbo image: $(BOARD_PREBUILT_DTBOIMAGE)")
Luca Stefanid9347002018-07-12 17:23:54 +020013 $(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
Rashed Abdel-Tawab60fe9352019-05-16 14:01:19 -070023$(BOARD_PREBUILT_DTBOIMAGE): $(MKDTIMG) $(INSTALLED_KERNEL_TARGET)
Luca Stefanid9347002018-07-12 17:23:54 +020024 $(build-dtboimage-target)
Luca Stefanid9347002018-07-12 17:23:54 +020025
26endif # BOARD_KERNEL_SEPARATED_DTBO
27endif # TARGET_NO_KERNEL