All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kernel-fitImage: allow overwrite the configuration dtb label
@ 2025-05-16 12:32 Oliver ROHE
  2025-05-16 13:35 ` [OE-core] " Mathieu Dubois-Briand
  2025-05-19 17:05 ` Freihofer, Adrian
  0 siblings, 2 replies; 8+ messages in thread
From: Oliver ROHE @ 2025-05-16 12:32 UTC (permalink / raw)
  To: openembedded-core@lists.openembedded.org

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(-)

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
--
2.43.0

Internal


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-05-27  8:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-16 12:32 [PATCH] kernel-fitImage: allow overwrite the configuration dtb label Oliver ROHE
2025-05-16 13:35 ` [OE-core] " Mathieu Dubois-Briand
2025-05-16 13:56   ` Oliver ROHE
2025-05-19 17:05 ` Freihofer, Adrian
2025-05-20  6:45   ` Andrej Valek
2025-05-20  8:51   ` Oliver ROHE
2025-05-25 15:41     ` Mathieu Dubois-Briand
2025-05-27  8:45       ` Oliver ROHE

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.