diff --git a/sys/conf/dtb.build.mk b/sys/conf/dtb.build.mk index 33a6413e0521..140440336cad 100644 --- a/sys/conf/dtb.build.mk +++ b/sys/conf/dtb.build.mk @@ -24,7 +24,16 @@ SYSDIR= ${_dir:tA} .error "can't find kernel source tree" .endif -DTB=${DTS:T:R:S/$/.dtb/} +.for _dts in ${DTS} +# DTB for aarch64 needs to preserve the immediate parent of the .dts, because +# these DTS are vendored and should be installed into their vendored directory. +.if ${MACHINE_ARCH} == "aarch64" +DTB+= ${_dts:R:S/$/.dtb/} +.else +DTB+= ${_dts:T:R:S/$/.dtb/} +.endif +.endfor + DTBO=${DTSO:T:R:S/$/.dtbo/} .SUFFIXES: .dtb .dts .dtbo .dtso