Skip to contentSkip to conversation

kernel-fitImage: Strip path component from dtb

PATCH New Ninad Palsule 1 participant 1 message Sep 27, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kernel-fitImage: Strip path component from dtb

Machines that have added subdirectires to the KERNEL_DEVICETREE recently, such as arm32 boards that were moved under subdirectories in Linux 6.5, will have that subdirectory in the node name of the FIT. This breaks existing systems that select a configuration in u-boot by it's name.

Strip off the directory component from the device tree to preserve compatibility.

---
 meta/classes-recipe/kernel-fitimage.bbclass | 5 +++++
 1 file changed, 5 insertions(+)
meta/classes-recipe/kernel-fitimage.bbclass +5 -0
index 13e8947f09..7e30a5d47e 100644
@@ -599,6 +599,11 @@ fitimage_assemble() {
 				DTB_PATH="${KERNEL_OUTPUT_DIR}/$DTB"
 			fi
 
+		        # Strip off the path component from the filename
+			if "${@'false' if oe.types.boolean(d.getVar('KERNEL_DTBVENDORED')) else 'true'}"; then
+			    DTB=`basename $DTB`
+			fi
+
 			# Set the default dtb image if it exists in the devicetree.
 			if [ ${FIT_CONF_DEFAULT_DTB} = $DTB ];then
 				default_dtb_image=$(echo "$DTB" | tr '/' '_')
Signature · 1 line
2.39.2