Skip to contentSkip to conversation

kernel-fitimage: Handle overlays in EXTERNAL_KERNEL_DEVICETREE

PATCH New Alex Kiernan 1 participant 1 message Feb 12, 2020

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 kernel-fitimage: Handle overlays in EXTERNAL_KERNEL_DEVICETREE

When using EXTERNAL_KERNEL_DEVICETREE, collect DTB overlays too (*.dtbo) as well as iterating down into sub-directories so using the behaviour for naming which matches KERNEL_DEVICETREE.

---

Changes in v2:
- ensure that the order of dtb/dtbo files in the generated fitimage is reproducible.

 meta/classes/kernel-fitimage.bbclass | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
meta/classes/kernel-fitimage.bbclass +2 -3
index ec18a3d69921..72b05ff8d1dd 100644
@@ -391,11 +391,10 @@ fitimage_assemble() {
 
 	if [ -n "${EXTERNAL_KERNEL_DEVICETREE}" ]; then
 		dtbcount=1
-		for DTBFILE in ${EXTERNAL_KERNEL_DEVICETREE}/*.dtb; do
-			DTB=`basename ${DTBFILE}`
+		for DTB in $(find "${EXTERNAL_KERNEL_DEVICETREE}" \( -name '*.dtb' -o -name '*.dtbo' \) -printf '%P\n' | sort); do
 			DTB=$(echo "${DTB}" | tr '/' '_')
 			DTBS="${DTBS} ${DTB}"
-			fitimage_emit_section_dtb ${1} ${DTB} ${DTBFILE}
+			fitimage_emit_section_dtb ${1} ${DTB} "${EXTERNAL_KERNEL_DEVICETREE}/${DTB}"
 		done
 	fi
 
Signature · 1 line
2.17.1