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 | |
| 6 | INSTALLED_DTBOIMAGE_TARGET := $(PRODUCT_OUT)/dtbo.img |
| 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 |
| 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 $@ |
| 21 | endef |
| 22 | |
| 23 | ifeq ($(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) |
| 31 | else |
| 32 | $(INSTALLED_DTBOIMAGE_TARGET): $(MKDTIMG) $(INSTALLED_KERNEL_TARGET) |
| 33 | $(build-dtboimage-target) |
| 34 | endif |
| 35 | |
| 36 | endif # BOARD_KERNEL_SEPARATED_DTBO |
| 37 | endif # TARGET_NO_KERNEL |