diff --git a/linux/Config.in b/linux/Config.in index f85d72068c..61e84f00b4 100644 --- a/linux/Config.in +++ b/linux/Config.in @@ -407,6 +407,13 @@ config BR2_LINUX_KERNEL_CUSTOM_DTS_PATH You can provide a list of dts paths to copy and build, separated by spaces. +config BR2_KERNEL_DTB_KEEP_DIRNAME + bool "Keep the directory name of the Device Tree" + help + If enabled, the device tree blobs keep their + directory prefixes when they get copied to the + output image directory or the target directory. + config BR2_LINUX_KERNEL_DTB_OVERLAY_SUPPORT bool "Build Device Tree with overlay support" help diff --git a/linux/linux.mk b/linux/linux.mk index ea7490d613..c3859a59d5 100644 --- a/linux/linux.mk +++ b/linux/linux.mk @@ -378,10 +378,11 @@ endef ifeq ($(BR2_LINUX_KERNEL_APPENDED_DTB),) define LINUX_INSTALL_DTB # dtbs moved from arch//boot to arch//boot/dts since 3.8-rc1 - cp $(addprefix \ - $(LINUX_ARCH_PATH)/boot/$(if $(wildcard \ - $(addprefix $(LINUX_ARCH_PATH)/boot/dts/,$(LINUX_DTBS))),dts/),$(LINUX_DTBS)) \ - $(1) + $(foreach dtb,$(LINUX_DTBS), \ + install -D \ + $(or $(wildcard $(LINUX_ARCH_PATH)/boot/dts/$(dtb)),$(LINUX_ARCH_PATH)/boot/$(dtb)) \ + $(1)/$(if $(BR2_KERNEL_DTB_KEEP_DIRNAME),$(dtb),$(notdir $(dtb))) + ) endef endif # BR2_LINUX_KERNEL_APPENDED_DTB endif # BR2_LINUX_KERNEL_DTB_IS_SELF_BUILT