diff mbox series

kernel-fitImage: allow overwrite the configuration dtb label

Message ID DB4PR08MB8102C882795C5B8725105A0F9E93A@DB4PR08MB8102.eurprd08.prod.outlook.com
State New
Headers show
Series kernel-fitImage: allow overwrite the configuration dtb label | expand

Commit Message

Oliver ROHE May 16, 2025, 12:32 p.m. UTC
This allows to provide a custom label for each dtb
without having to overwrite the whole function.

Signed-off-by: Oliver Rohe <oliver.rohe@wago.com>
---
 meta/classes-recipe/kernel-fitimage.bbclass | 26 ++++++++++++++-------
 1 file changed, 18 insertions(+), 8 deletions(-)

--
2.43.0

Internal

Comments

Mathieu Dubois-Briand May 16, 2025, 1:35 p.m. UTC | #1
On Fri May 16, 2025 at 2:32 PM CEST, Oliver ROHE via lists.openembedded.org wrote:
> This allows to provide a custom label for each dtb
> without having to overwrite the whole function.
>
> Signed-off-by: Oliver Rohe <oliver.rohe@wago.com>
> ---

Hi Oliver,

Thanks for your patch.

Just a first note about it: it looks like tabs in the patch were
replaced by spaces, so this is a bit painful to apply on our side. It
might come from your mailer setup. Are you using git send-email command?

I've corrected the spacing on my side for this patch, but may you have a
look at your configuration for the next time?

Thanks
Mathieu
Oliver ROHE May 16, 2025, 1:56 p.m. UTC | #2
> I've corrected the spacing on my side for this patch, but may you have a
> look at your configuration for the next time?

Thanks a lot Mathieu, unfortunately my company uses exchange,
but I'll make sure it's properly formatted next time!


Internal
diff mbox series

Patch

diff --git a/meta/classes-recipe/kernel-fitimage.bbclass b/meta/classes-recipe/kernel-fitimage.bbclass
index 07786647e1..f770d65087 100644
--- a/meta/classes-recipe/kernel-fitimage.bbclass
+++ b/meta/classes-recipe/kernel-fitimage.bbclass
@@ -344,6 +344,15 @@  symlink_points_below() {
        echo "$realpath"
 }

+#
+# Simple function to allow overwriting the configuration node label
+#
+# $1 ... DTB image name
+fitimage_emit_section_config_dtb_label() {
+       dtb_img="$1"
+       echo "${FIT_CONF_PREFIX}${dtb_img}"
+}
+
 #
 # Emit the fitImage ITS configuration section
 #
@@ -404,7 +413,7 @@  fitimage_emit_section_config() {
        # conf node name is selected based on dtb ID if it is present,
        # otherwise its selected based on kernel ID
        if [ -n "$dtb_image" ]; then
-               conf_node=$conf_node$dtb_image
+               conf_node=$(fitimage_emit_section_config_dtb_label $dtb_image)
        else
                conf_node=$conf_node$kernel_id
        fi
@@ -442,13 +451,14 @@  fitimage_emit_section_config() {
                # default node is selected based on dtb ID if it is present,
                # otherwise its selected based on kernel ID
                if [ -n "$dtb_image" ]; then
-                       # Select default node as user specified dtb when
-                       # multiple dtb exists.
-                       if [ -n "$default_dtb_image" ]; then
-                               default_line="default = \"${FIT_CONF_PREFIX}$default_dtb_image\";"
-                       else
-                               default_line="default = \"${FIT_CONF_PREFIX}$dtb_image\";"
-                       fi
+                       # Select default node as user specified dtb when
+                       # multiple dtb exists.
+                       if [ -n "$default_dtb_image" ]; then
+                               img=$default_dtb_image
+                       else
+                               img=$dtb_img
+                       fi
+                       default_line="default = \"$(fitimage_emit_section_config_dtb_label $img)\";"
                else
                        default_line="default = \"${FIT_CONF_PREFIX}$kernel_id\";"
                fi