Luca Stefani | d934700 | 2018-07-12 17:23:54 +0200 | [diff] [blame] | 1 | ifneq ($(TARGET_NO_KERNEL),true) |
| 2 | ifeq ($(strip $(BOARD_KERNEL_SEPARATED_DTBO)),true) |
| 3 | |
| 4 | MKDTIMG := $(HOST_OUT_EXECUTABLES)/mkdtimg$(HOST_EXECUTABLE_SUFFIX) |
| 5 | |
Rashed Abdel-Tawab | 60fe935 | 2019-05-16 14:01:19 -0700 | [diff] [blame] | 6 | BOARD_PREBUILT_DTBOIMAGE := $(PRODUCT_OUT)/dtbo-pre.img |
Luca Stefani | d934700 | 2018-07-12 17:23:54 +0200 | [diff] [blame] | 7 | |
| 8 | # Most specific paths must come first in possible_dtbo_dirs |
| 9 | possible_dtbo_dirs = $(KERNEL_OUT)/arch/$(KERNEL_ARCH)/boot/dts $(KERNEL_OUT)/arch/arm/boot/dts |
| 10 | |
| 11 | define build-dtboimage-target |
Rashed Abdel-Tawab | 60fe935 | 2019-05-16 14:01:19 -0700 | [diff] [blame] | 12 | $(call pretty,"Target dtbo image: $(BOARD_PREBUILT_DTBOIMAGE)") |
Luca Stefani | d934700 | 2018-07-12 17:23:54 +0200 | [diff] [blame] | 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 $@ |
| 21 | endef |
| 22 | |
Rashed Abdel-Tawab | 60fe935 | 2019-05-16 14:01:19 -0700 | [diff] [blame] | 23 | $(BOARD_PREBUILT_DTBOIMAGE): $(MKDTIMG) $(INSTALLED_KERNEL_TARGET) |
Luca Stefani | d934700 | 2018-07-12 17:23:54 +0200 | [diff] [blame] | 24 | $(build-dtboimage-target) |
Luca Stefani | d934700 | 2018-07-12 17:23:54 +0200 | [diff] [blame] | 25 | |
| 26 | endif # BOARD_KERNEL_SEPARATED_DTBO |
| 27 | endif # TARGET_NO_KERNEL |