Skip to contentSkip to conversation

kernel-fitImage: only include valid compatible line

PATCH Denis OSTERLAND-HEIM 1 participant 1 message Mar 7, 2024

lore
Share & tools
lore

Denis OSTERLAND-HEIM

author Reviewed-by
#0 lore raw

Hi,

-----Original Message-----

Quoted 1 line

From: [email protected]

<[email protected]>

Quoted 3 lines

Sent: Wednesday, March 6, 2024 5:42 PM
To: [email protected]
Cc: [email protected]; Denis OSTERLAND-HEIM

<[email protected]>; Christian Taedcke
<[email protected]>

Quoted 1 line

Subject: [EXT] [OE-core][PATCH v2] kernel-fitImage: only include valid

compatible line

Quoted 7 lines

[EXTERNAL EMAIL]

From: Christian Taedcke <[email protected]>

Without this commit the configuration node includes the compatible line

'compatible = [00];' if EXTERNAL_KERNEL_DEVICETREE is not defined, i.e. if PREFERRED_PROVIDER_virtual/dtb is not used.
Right.
This should definetly should check for kernel path, too.
This patch adds the savety net.
To get it working in all cases (external, internal, KERNEL_DTBVENDORED=True/False),
I guess the compatible string have to be extracted in fitimage_assemble() and passed to fitimage_emit_section_config().
But that´s a story for a nother patch ;-)

Quoted 1 line

This prevents u-boot from using this configuration and it prints the

message "Could not find configuration node".

Quoted 2 lines

An additional check also ensures that the written compatible line never

contains an empty compatible.
Ack

Quoted 3 lines

The functionality to add the compatible line was added in commit f4c82fb6da89 ("kernel-fitImage: add machine compatible to config

section").

Fixes f4c82fb6da89 ("kernel-fitImage: add machine compatible to config

section")

Quoted 2 lines

Regards, Denis

Review

Quoted 5 lines
---
 meta/classes-recipe/kernel-fitimage.bbclass | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
(quoted diff) +0 -0

b/meta/classes-recipe/kernel-fitimage.bbclass

meta/classes-recipe/kernel-fitimage.bbclass fitimage_emit_section_config() { · line 426

Quoted 10 lines

index 7e30a5d47e..4b74ddc201 100644

meta/classes-recipe/kernel-fitimage.bbclass +1 -0
@@ -421,6 +421,7 @@ fitimage_emit_section_config() {
 	bootscr_line=""
 	setup_line=""
 	default_line=""
+	compatible_line=""
 
 	dtb_image_sect=$(symlink_points_below $dtb_image

"${EXTERNAL_KERNEL_DEVICETREE}")

meta/classes-recipe/kernel-fitimage.bbclass fitimage_emit_section_config() { · line 431

Quoted 6 lines
meta/classes-recipe/kernel-fitimage.bbclass +0 -1
 	if [ -z "$dtb_image_sect" ]; then
@@ -428,7 +429,12 @@ fitimage_emit_section_config() {
 	fi
 
 	dtb_path="${EXTERNAL_KERNEL_DEVICETREE}/${dtb_image_sect}"
-	compatible_line="compatible = \"$(fdtget "$dtb_path" / compatible |

sed 's/ /", "/g')\";"

meta/classes-recipe/kernel-fitimage.bbclass fitimage_emit_section_config() { · line 433

Quoted 2 lines
meta/classes-recipe/kernel-fitimage.bbclass +2 -0
+	if [ -e "$dtb_path" ]; then
+		compat=$(fdtget -t s "$dtb_path" / compatible | sed 's/ /",

"/g')

Quoted 11 lines
meta/classes-recipe/kernel-fitimage.bbclass +4 -1
+		if [ -n "$compat" ]; then
+			compatible_line="compatible = \"$compat\";"
+		fi
+	fi
 
 	dtb_image=$(echo $dtb_image | tr '/' '_')
 	dtb_image_sect=$(echo "${dtb_image_sect}" | tr '/' '_')
--

2.34.1