@@ -31,7 +31,8 @@ mkfs_target_dir = $(if $(call param_get,pkg,$(1)),$(KDIR)/target-dir-$(call para
KDIR=$(KERNEL_BUILD_DIR)
KDIR_TMP=$(KDIR)/tmp
-DTS_DIR:=$(LINUX_DIR)/arch/$(LINUX_KARCH)/boot/dts
+DTS_DIR:=$(LINUX_SRC_DIR)/arch/$(LINUX_KARCH)/boot/dts
+DTB_DIR:=$(LINUX_OBJ_DIR)/arch/$(LINUX_KARCH)/boot/dts
IMG_PREFIX_EXTRA:=$(if $(EXTRA_IMAGE_NAME),$(call sanitize,$(EXTRA_IMAGE_NAME))-)
IMG_PREFIX_VERNUM:=$(if $(CONFIG_VERSION_FILENAMES),$(call sanitize,$(VERSION_NUMBER))-)
@@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/image.mk
kernel_ep = `$(KERNEL_CROSS)readelf -h $(1) | grep "Entry point address" | grep -o 0x.*`
define Build/patch-dtb
- $(STAGING_DIR_HOST)/bin/patch-dtb $@ $(DTS_DIR)/$(DEVICE_DTS).dtb
+ $(STAGING_DIR_HOST)/bin/patch-dtb $@ $(DTB_DIR)/$(DEVICE_DTS).dtb
endef
ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
@@ -41,7 +41,7 @@ FAT32_BLOCKS=$(shell echo $$(($(CONFIG_AXS10X_SD_BOOT_PARTSIZE)*1024*1024/$(FAT3
define Image/Prepare
# Build .dtb for all boards we may run on
$(foreach dts,$(DEVICE_DTS_LIST),
- $(call Image/BuildDTB,$(DTS_DIR)/$(dts).dts,$(DTS_DIR)/$(dts).dtb)
+ $(call Image/BuildDTB,$(DTS_DIR)/$(dts).dts,$(DTB_DIR)/$(dts).dtb)
)
endef
@@ -51,7 +51,7 @@ define Image/Build/SDCard
mkimage -C none -A arc -T script -d uEnv.txt $(BIN_DIR)/uEnv.scr
mkenvimage -s 0x4000 -o $(BIN_DIR)/uboot.env ./uboot.env.txt
mcopy -i $(KDIR_TMP)/$(IMG_PREFIX)-$(PROFILE)-boot.img $(BIN_DIR)/uEnv.scr ::boot.scr
- mcopy -i $(KDIR_TMP)/$(IMG_PREFIX)-$(PROFILE)-boot.img $(DTS_DIR)/*.dtb ::
+ mcopy -i $(KDIR_TMP)/$(IMG_PREFIX)-$(PROFILE)-boot.img $(DTB_DIR)/*.dtb ::
mcopy -i $(KDIR_TMP)/$(IMG_PREFIX)-$(PROFILE)-boot.img $(BIN_DIR)/$(IMG_PREFIX)-uImage ::uImage
mcopy -i $(KDIR_TMP)/$(IMG_PREFIX)-$(PROFILE)-boot.img $(BIN_DIR)/uboot.env ::uboot.env
@@ -23,9 +23,9 @@ define Build/boot-common
mcopy -i $@.boot config.txt ::
mcopy -i $@.boot distroconfig.txt ::
mcopy -i $@.boot $(IMAGE_KERNEL) ::$(KERNEL_IMG)
- $(foreach dts,$(shell echo $(DEVICE_DTS)),mcopy -i $@.boot $(DTS_DIR)/$(dts).dtb ::;)
+ $(foreach dts,$(shell echo $(DEVICE_DTS)),mcopy -i $@.boot $(DTB_DIR)/$(dts).dtb ::;)
mmd -i $@.boot ::/overlays
- mcopy -i $@.boot $(DTS_DIR)/overlays/*.dtbo ::/overlays/
+ mcopy -i $@.boot $(DTB_DIR)/overlays/*.dtbo ::/overlays/
mcopy -i $@.boot $(DTS_DIR)/overlays/README ::/overlays/
endef
@@ -32,7 +32,7 @@ define Build/bcm4908img
mkdir -p $@-bootfs
cp -r $(DEVICE_NAME)/* $@-bootfs/
touch $@-bootfs/1-openwrt
- cp $(DTS_DIR)/$(firstword $(DEVICE_DTS)).dtb $@-bootfs/94908.dtb
+ cp $(DTB_DIR)/$(firstword $(DEVICE_DTS)).dtb $@-bootfs/94908.dtb
cp $(KDIR)/bcm63xx-cfe/$(subst _,$(comma),$(DEVICE_NAME))/cferam.000 $@-bootfs/
cp $(IMAGE_KERNEL) $@-bootfs/vmlinux.lz
@@ -146,7 +146,7 @@ define Device/Default
PROFILES = Generic $$(DEVICE_NAME)
# .dtb files are prefixed by SoC type, e.g. bcm4708- which is not included in device/image names
# extract the full dtb name based on the device info
- DEVICE_DTS := $(patsubst %.dtb,%,$(notdir $(wildcard $(if $(IB),$(KDIR),$(DTS_DIR))/*-$(subst _,-,$(1)).dtb)))
+ DEVICE_DTS := $(patsubst %.dtb,%,$(notdir $(wildcard $(if $(IB),$(KDIR),$(DTB_DIR))/*-$(subst _,-,$(1)).dtb)))
KERNEL := kernel-bin | append-dtb | lzma-d16
KERNEL_DEPENDS = $$(wildcard $(DTS_DIR)/$$(DEVICE_DTS).dts)
KERNEL_INITRAMFS_SUFFIX := .trx
@@ -407,9 +407,9 @@ define Device/meraki_mr32
KERNEL_INITRAMFS_SUFFIX := .bin
DEVICE_DTS_DELIMITER := @
DEVICE_DTS_CONFIG := config@1
- KERNEL_INITRAMFS := kernel-bin | fit none $$(DTS_DIR)/$$(DEVICE_DTS).dtb | \
+ KERNEL_INITRAMFS := kernel-bin | fit none $$(DTB_DIR)/$$(DEVICE_DTS).dtb | \
pad-to 10362880
- KERNEL := kernel-bin | fit none $$(DTS_DIR)/$$(DEVICE_DTS).dtb
+ KERNEL := kernel-bin | fit none $$(DTB_DIR)/$$(DEVICE_DTS).dtb
IMAGES += sysupgrade.bin
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
@@ -12,7 +12,7 @@ define Build/imx-combined-image
$(foreach dts,$(DEVICE_DTS), \
$(CP) \
- $(DTS_DIR)/$(dts).dtb \
+ $(DTB_DIR)/$(dts).dtb \
$@.boot/;
)
@@ -11,7 +11,7 @@ define Build/boot-overlay
$(foreach dts,$(DEVICE_DTS), \
$(CP) \
- $(DTS_DIR)/$(dts).dtb \
+ $(DTB_DIR)/$(dts).dtb \
$@.boot/$(IMG_PREFIX)-$(dts).dtb; \
ln -sf \
$(IMG_PREFIX)-$(dts).dtb \
@@ -58,7 +58,7 @@ define Build/ventana-img
$(CP) $(IMAGE_KERNEL) $@.boot/boot/uImage
$(foreach dts,$(DEVICE_DTS), \
$(CP) \
- $(DTS_DIR)/$(dts).dtb \
+ $(DTB_DIR)/$(dts).dtb \
$@.boot/boot/;
)
mkimage -A arm -O linux -T script -C none -a 0 -e 0 \
@@ -20,7 +20,7 @@ LS_SYSUPGRADE_IMAGE_SIZE = 49m
define Image/Prepare
# Build .dtb for all boards we may run on
$(foreach dts,$(DEVICE_DTS_LIST),
- $(call Image/BuildDTB,$(DTS_DIR)/$(dts).dts,$(DTS_DIR)/$(dts).dtb)
+ $(call Image/BuildDTB,$(DTS_DIR)/$(dts).dts,$(DTB_DIR)/$(dts).dtb)
)
endef
@@ -33,7 +33,7 @@ define Build/ls-append
endef
define Build/ls-append-dtb
- dd if=$(DTS_DIR)/$(1).dtb >> $@
+ dd if=$(DTB_DIR)/$(1).dtb >> $@
endef
define Build/ls-append-kernel
@@ -59,9 +59,9 @@ define Build/traverse-fit-ls1088
-v $(LINUX_VERSION) -k $@ -a $(KERNEL_LOADADDR) \
-e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \
-C gzip -c 1 -c 2 \
- -d $(DTS_DIR)/freescale/fsl-ls1088a-ten64.dtb \
+ -d $(DTB_DIR)/freescale/fsl-ls1088a-ten64.dtb \
-D "TEN64" -n "ten64" -a $(FDT_LOADADDR) -c 1 \
- -d $(DTS_DIR)/freescale/fsl-ls1088a-rdb.dtb \
+ -d $(DTB_DIR)/freescale/fsl-ls1088a-rdb.dtb \
-D "LS1088ARDB" -n "ls1088ardb" -a $(FDT_LOADADDR) -c 2
PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@.new
@mv -f $@.new $@
@@ -7,7 +7,7 @@ define Device/Default
FILESYSTEMS := squashfs
IMAGES := firmware.bin sysupgrade.bin
KERNEL := kernel-bin | uImage none
- KERNEL_INITRAMFS = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb
+ KERNEL_INITRAMFS = kernel-bin | gzip | fit gzip $$(DTB_DIR)/$$(DEVICE_DTS).dtb
KERNEL_NAME := zImage
KERNEL_LOADADDR := 0x80008000
DEVICE_DTS = $(lastword $(subst _, ,$(1)))
@@ -20,7 +20,7 @@ define Device/Default
endef
define Device/fsl-sdboot
- KERNEL = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb
+ KERNEL = kernel-bin | gzip | fit gzip $$(DTB_DIR)/$$(DEVICE_DTS).dtb
IMAGES := sdcard.img.gz sysupgrade.bin
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
endef
@@ -7,7 +7,7 @@ define Device/Default
IMAGES := firmware.bin sysupgrade.bin
FILESYSTEMS := squashfs
KERNEL := kernel-bin | gzip | uImage gzip
- KERNEL_INITRAMFS = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb
+ KERNEL_INITRAMFS = kernel-bin | gzip | fit gzip $$(DTB_DIR)/$$(DEVICE_DTS).dtb
KERNEL_LOADADDR := 0x80000000
DEVICE_DTS = freescale/$(subst _,-,$(1))
IMAGE_SIZE := 64m
@@ -19,7 +19,7 @@ define Device/Default
endef
define Device/fsl-sdboot
- KERNEL = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb
+ KERNEL = kernel-bin | gzip | fit gzip $$(DTB_DIR)/$$(DEVICE_DTS).dtb
IMAGES := sdcard.img.gz sysupgrade.bin
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
endef
@@ -45,7 +45,7 @@ define Device/fsl_ls1012a-frdm
append-kernel | pad-to $$(BLOCKSIZE) | \
append-rootfs | pad-rootfs | \
check-size $(LS_SYSUPGRADE_IMAGE_SIZE) | append-metadata
- KERNEL := kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb
+ KERNEL := kernel-bin | gzip | fit gzip $$(DTB_DIR)/$$(DEVICE_DTS).dtb
endef
TARGET_DEVICES += fsl_ls1012a-frdm
@@ -103,7 +103,7 @@ define Device/fsl_ls1028a-rdb
DEVICE_MODEL := LS1028A-RDB
DEVICE_VARIANT := Default
DEVICE_DTS := freescale/fsl-ls1028a-rdb
- KERNEL = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb
+ KERNEL = kernel-bin | gzip | fit gzip $$(DTB_DIR)/$$(DEVICE_DTS).dtb
DEVICE_PACKAGES += \
trusted-firmware-a-ls1028a-rdb \
kmod-hwmon-ina2xx \
@@ -440,7 +440,7 @@ define Device/traverse_ten64_mtd
KERNEL_SUFFIX := -kernel.itb
DEVICE_DTS := freescale/fsl-ls1088a-ten64
IMAGES := nand.ubi sysupgrade.bin
- KERNEL := kernel-bin | gzip | traverse-fit-ls1088 gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb $$(FDT_LOADADDR)
+ KERNEL := kernel-bin | gzip | traverse-fit-ls1088 gzip $$(DTB_DIR)/$$(DEVICE_DTS).dtb $$(FDT_LOADADDR)
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
IMAGE/nand.ubi := append-ubi
KERNEL_IN_UBI := 1
@@ -111,8 +111,8 @@ ifeq ($(DUMP),)
IMAGE_SIZE := $$(shell expr 45 + $$(CONFIG_TARGET_ROOTFS_PARTSIZE))m
endif
KERNEL := kernel-bin | gzip
- KERNEL_INITRAMFS := kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb with-initrd | pad-to 128k
- IMAGE/sysupgrade.itb := append-kernel | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb external-static-with-rootfs | append-metadata
+ KERNEL_INITRAMFS := kernel-bin | lzma | fit lzma $$(DTB_DIR)/$$(DEVICE_DTS).dtb with-initrd | pad-to 128k
+ IMAGE/sysupgrade.itb := append-kernel | fit gzip $$(DTB_DIR)/$$(DEVICE_DTS).dtb external-static-with-rootfs | append-metadata
DEVICE_COMPAT_VERSION := 1.1
DEVICE_COMPAT_MESSAGE := Device tree overlay mechanism needs bootloader update
endef
@@ -95,11 +95,11 @@ define Device/bananapi_bpi-r2
IMAGES := sysupgrade.itb
KERNEL := kernel-bin | gzip
KERNEL_INITRAMFS_SUFFIX := -recovery.itb
- KERNEL_INITRAMFS := kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb with-initrd
+ KERNEL_INITRAMFS := kernel-bin | gzip | fit gzip $$(DTB_DIR)/$$(DEVICE_DTS).dtb with-initrd
ifeq ($(DUMP),)
IMAGE_SIZE := $$(shell expr 48 + $$(CONFIG_TARGET_ROOTFS_PARTSIZE))m
endif
- IMAGE/sysupgrade.itb := append-kernel | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb external-static-with-rootfs | append-metadata
+ IMAGE/sysupgrade.itb := append-kernel | fit gzip $$(DTB_DIR)/$$(DEVICE_DTS).dtb external-static-with-rootfs | append-metadata
ARTIFACT/preloader.bin := mt7623-mbr emmc |\
pad-to 2k | append-preloader $$(UBOOT_TARGET)
ARTIFACT/u-boot.bin := append-uboot
@@ -22,7 +22,7 @@ define Build/mxs-sdcard-vfat-ext4
rm -f $@.boot
mkfs.fat $@.boot -C $(FAT32_BLOCKS)
- mcopy -i $@.boot $(DTS_DIR)/$(DEVICE_DTS).dtb ::$(DEVICE_DTS).dtb
+ mcopy -i $@.boot $(DTB_DIR)/$(DEVICE_DTS).dtb ::$(DEVICE_DTS).dtb
mcopy -i $@.boot $(IMAGE_KERNEL) ::uImage
./gen_sdcard_vfat_ext4.sh \
@@ -19,7 +19,7 @@ define Build/omap-sdcard
mcopy -i $@.boot $(STAGING_DIR_IMAGE)/$(DEVICE_NAME)/u-boot.img ::u-boot.img
mcopy -i $@.boot $(STAGING_DIR_IMAGE)/$(DEVICE_NAME)/boot.scr ::boot.scr
mmd -i $@.boot ::/dtbs
- mcopy -i $@.boot $(DTS_DIR)/$(DEVICE_DTS).dtb ::/dtbs/$(DEVICE_DTS).dtb
+ mcopy -i $@.boot $(DTB_DIR)/$(DEVICE_DTS).dtb ::/dtbs/$(DEVICE_DTS).dtb
mcopy -i $@.boot $(IMAGE_KERNEL) ::/zImage
./gen_omap_sdcard_img.sh $@ \
$@.boot \
@@ -11,7 +11,7 @@ define Device/Default
PROFILES := Default
FILESYSTEMS := squashfs
KERNEL_DEPENDS = $$(wildcard $$(DTS_DIR)/$$(DEVICE_DTS).dts)
- KERNEL = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb
+ KERNEL = kernel-bin | gzip | fit gzip $$(DTB_DIR)/$$(DEVICE_DTS).dtb
KERNEL_SUFFIX := -kernel.itb
KERNEL_INSTALL := 1
KERNEL_IN_UBI := 1
@@ -47,7 +47,7 @@ endef
### Devices ###
define Device/Default
PROFILES := Default
- KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb
+ KERNEL = kernel-bin | lzma | fit lzma $$(DTB_DIR)/$$(DEVICE_DTS).dtb
IMAGES := sysupgrade.img.gz
DEVICE_DTS = rockchip/$$(SOC)-$(lastword $(subst _, ,$(1)))
UBOOT_DEVICE_NAME = $(lastword $(subst _, ,$(1)))-$$(SOC)
@@ -15,7 +15,7 @@ define Build/riscv-sdcard
mkfs.fat $@.boot -C $(FAT32_BLOCKS)
mcopy -i $@.boot $(STAGING_DIR_IMAGE)/$(DEVICE_NAME)-boot.scr ::boot.scr
- mcopy -i $@.boot $(DTS_DIR)/$(DEVICE_DTS).dtb ::dtb
+ mcopy -i $@.boot $(DTB_DIR)/$(DEVICE_DTS).dtb ::dtb
mcopy -i $@.boot $(IMAGE_KERNEL) ::Image
./gen_sifiveu_sdcard_img.sh \
@@ -17,7 +17,7 @@ define Build/sunxi-sdcard
mkfs.fat $@.boot -C $(FAT32_BLOCKS)
mcopy -i $@.boot $(STAGING_DIR_IMAGE)/$(DEVICE_NAME)-boot.scr ::boot.scr
- mcopy -i $@.boot $(DTS_DIR)/$(SUNXI_DTS).dtb ::dtb
+ mcopy -i $@.boot $(DTB_DIR)/$(SUNXI_DTS).dtb ::dtb
mcopy -i $@.boot $(IMAGE_KERNEL) ::uImage
./gen_sunxi_sdcard_img.sh $@ \
$@.boot \
@@ -10,8 +10,8 @@ define Build/tegra-sdcard
mkdir -p $@.boot
$(CP) $(KDIR)/$(KERNEL_NAME) $@.boot
$(if $(DEVICE_DTS),\
- $(foreach dtb,$(DEVICE_DTS),$(CP) $(DTS_DIR)/$(dtb).dtb $@.boot), \
- $(CP) $(DTS_DIR)/*.dtb $@.boot)
+ $(foreach dtb,$(DEVICE_DTS),$(CP) $(DTB_DIR)/$(dtb).dtb $@.boot), \
+ $(CP) $(DTB_DIR)/*.dtb $@.boot)
mkimage -A arm -O linux -T script -C none -a 0 -e 0 \
-n '$(DEVICE_TITLE) OpenWrt bootscript' \
-d $(BOOT_SCRIPT) \
@@ -38,7 +38,7 @@ endef
define Device/FitImageGzip
KERNEL_SUFFIX := -fit-uImage.itb
- KERNEL = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb
+ KERNEL = kernel-bin | gzip | fit gzip $$(DTB_DIR)/$$(DEVICE_DTS).dtb
KERNEL_NAME := Image
endef
This has an issue similar to $(LINUX_DIR), $(DTS_DIR) was being used for both source and compiled. Create $(DTB_DIR) for the compiled binaries. Signed-off-by: Elliott Mitchell <ehem+openwrt@m5p.com> --- Issue with this commit is I'm unsure I've gotten everything and unsure I've gotten the ones I found correct. --- include/image.mk | 3 ++- target/linux/archs38/image/Makefile | 6 +++--- target/linux/bcm27xx/image/Makefile | 4 ++-- target/linux/bcm4908/image/Makefile | 2 +- target/linux/bcm53xx/image/Makefile | 6 +++--- target/linux/imx/image/common.mk | 2 +- target/linux/imx/image/cortexa9.mk | 4 ++-- target/linux/layerscape/image/Makefile | 8 ++++---- target/linux/layerscape/image/armv7.mk | 4 ++-- target/linux/layerscape/image/armv8_64b.mk | 10 +++++----- target/linux/mediatek/image/mt7622.mk | 4 ++-- target/linux/mediatek/image/mt7623.mk | 4 ++-- target/linux/mxs/image/Makefile | 2 +- target/linux/omap/image/Makefile | 2 +- target/linux/pistachio/image/Makefile | 2 +- target/linux/rockchip/image/Makefile | 2 +- target/linux/sifiveu/image/Makefile | 2 +- target/linux/sunxi/image/Makefile | 2 +- target/linux/tegra/image/Makefile | 4 ++-- target/linux/zynq/image/Makefile | 2 +- 20 files changed, 38 insertions(+), 37 deletions(-)