Skip to contentSkip to conversation

uboot-extlinux-config.bbclass: Add menu title configuration

PATCH New Daniel Semkowicz 1 participant 4 messages Oct 2, 2023

lore
Share & tools
lore
#0 lore raw

cover uboot-extlinux-config.bbclass: Add menu title configuration

Add new UBOOT_EXTLINUX_MENU_TITLE variable that allows configuring the "MENU TITLE" entry.

Daniel Semkowicz (3):
uboot-extlinux-config.bbclass: Remove repeated space character uboot-extlinux-config.bbclass: Uppercase "menu title" entry uboot-extlinux-config.bbclass: Add menu title configuration

 meta/classes-recipe/uboot-extlinux-config.bbclass | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
Signature · 1 line
2.41.0
#1 lore raw

PATCH 1/3 uboot-extlinux-config.bbclass: Remove repeated space character

---
 meta/classes-recipe/uboot-extlinux-config.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes-recipe/uboot-extlinux-config.bbclass +1 -1
index f752c16b9c..f99100708d 100644
@@ -98,7 +98,7 @@ python do_create_extlinux_config() {
             if len(labels.split()) > 1:
                 cfgfile.write('menu title Select the boot mode\n')
 
-            timeout =  localdata.getVar('UBOOT_EXTLINUX_TIMEOUT')
+            timeout = localdata.getVar('UBOOT_EXTLINUX_TIMEOUT')
             if timeout:
                 cfgfile.write('TIMEOUT %s\n' % (timeout))
 
Signature · 1 line
2.41.0
#2 lore raw

PATCH 2/3 uboot-extlinux-config.bbclass: Uppercase "menu title" entry

In reply to Daniel Semkowicz

All other extlinux.conf entries are written to the output file in uppercase.

---
 meta/classes-recipe/uboot-extlinux-config.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes-recipe/uboot-extlinux-config.bbclass +1 -1
index f99100708d..a7f325ff2d 100644
@@ -96,7 +96,7 @@ python do_create_extlinux_config() {
             cfgfile.write('# Generic Distro Configuration file generated by OpenEmbedded\n')
 
             if len(labels.split()) > 1:
-                cfgfile.write('menu title Select the boot mode\n')
+                cfgfile.write('MENU TITLE Select the boot mode\n')
 
             timeout = localdata.getVar('UBOOT_EXTLINUX_TIMEOUT')
             if timeout:
Signature · 1 line
2.41.0
#3 lore raw

PATCH 3/3 uboot-extlinux-config.bbclass: Add menu title configuration

In reply to Daniel Semkowicz

Add new UBOOT_EXTLINUX_MENU_TITLE variable that allows configuring the "MENU TITLE" entry.

If set to empty, "MENU TITLE" will not be added to the output file.

---
 meta/classes-recipe/uboot-extlinux-config.bbclass | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
meta/classes-recipe/uboot-extlinux-config.bbclass +6 -2
index a7f325ff2d..30bbea57de 100644
@@ -23,6 +23,8 @@
 #                                    Measured in 1/10 of a second.
 # UBOOT_EXTLINUX_DEFAULT_LABEL     - Target to be selected by default after
 #                                    the timeout period.
+# UBOOT_EXTLINUX_MENU_TITLE        - Menu title. If empty, MENU TITLE entry
+#                                    will not be added to the output file.
 # UBOOT_EXTLINUX_CONFIG            - Output file.
 #
 # If there's only one label system will boot automatically and menu won't be
@@ -68,6 +70,7 @@ UBOOT_EXTLINUX_FDTDIR ??= "../"
 UBOOT_EXTLINUX_KERNEL_IMAGE ??= "../${KERNEL_IMAGETYPE}"
 UBOOT_EXTLINUX_KERNEL_ARGS ??= "rootwait rw"
 UBOOT_EXTLINUX_MENU_DESCRIPTION:linux ??= "${DISTRO_NAME}"
+UBOOT_EXTLINUX_MENU_TITLE ??= "Select the boot mode"
 
 UBOOT_EXTLINUX_CONFIG = "${B}/extlinux.conf"
 
@@ -95,8 +98,9 @@ python do_create_extlinux_config() {
         with open(cfile, 'w') as cfgfile:
             cfgfile.write('# Generic Distro Configuration file generated by OpenEmbedded\n')
 
-            if len(labels.split()) > 1:
-                cfgfile.write('MENU TITLE Select the boot mode\n')
+            menu_title = localdata.getVar('UBOOT_EXTLINUX_MENU_TITLE')
+            if len(labels.split()) > 1 and menu_title:
+                cfgfile.write('MENU TITLE %s\n' % (menu_title))
 
             timeout = localdata.getVar('UBOOT_EXTLINUX_TIMEOUT')
             if timeout:
Signature · 1 line
2.41.0