Hello,

I believe we've found a bug in the `uboot-extlinux-config.bbclass` class and 
was hoping for confirmation. Please feel free to point me in the right 
direction if this isn't the appropriate mailing list.

A few years ago U-boot was patched to properly parse the PROMPT value in 
extlinux.conf files and restore the default menu behavior to prompt for a label 
unless explicitly disabled.
- See this bug report: 
https://groups.google.com/g/linux.debian.bugs.dist/c/wI_3vFvErTc
- Which was upstreamed here: 
https://github.com/u-boot/u-boot/commit/739e8361f3fe78038251216df6096a32bc2d5839

After updating our yocto build to a newer branch on Scarthgap, we started 
seeing these prompts for extlinux labels from U-boot. The boot prompt that gets 
displayed is interruptible via <CTRL-C>, which is a potential security 
vulnerability, so we would like to disable the extlinux boot prompt altogether. 
However, there exists no option in `uboot-extlinux-config.bbclass` for 
explicitly setting the PROMPT option.

I've generated a small fix that would allow developers to explicitly set the 
PROMPT value similarly to any other (E.G. TIMEOUT). Could someone confirm 
whether or not the missing PROMPT variable in `uboot-extlinux-config.bbclass` 
is intentional? If not, I can generate a proper patch to submit for review as 
necessary.

```
diff --git a/meta/classes-recipe/uboot-extlinux-config.bbclass 
b/meta/classes-recipe/uboot-extlinux-config.bbclass
index 0413e760bd..659560c675 100644
--- a/meta/classes-recipe/uboot-extlinux-config.bbclass
+++ b/meta/classes-recipe/uboot-extlinux-config.bbclass
@@ -21,6 +21,7 @@
# UBOOT_EXTLINUX_ROOT              - Root kernel cmdline.
# UBOOT_EXTLINUX_TIMEOUT           - Timeout before DEFAULT selection is made.
#                                    Measured in 1/10 of a second.
+# UBOOT_EXTLINUX_PROMPT            - Enable/disable prompting for a boot label.
# 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
@@ -106,6 +107,10 @@ python do_create_extlinux_config() {
             if timeout:
                 cfgfile.write('TIMEOUT %s\n' % (timeout))

+            prompt = localdata.getVar('UBOOT_EXTLINUX_PROMPT')
+            if prompt:
+                cfgfile.write('PROMPT %s\n' % (prompt))
+
             if len(labels.split()) > 1:
                 default = localdata.getVar('UBOOT_EXTLINUX_DEFAULT_LABEL')
                 if default:
```


Additionally, despite the documentation stating that no prompt shall be 
displayed when only one boot label exists, we are still seeing prompting 
behavior with only one extlinux boot label. Would someone be able to confirm 
that this is not limited to just our platform?

-          
https://github.com/openembedded/openembedded-core/blob/master/meta/classes-recipe/uboot-extlinux-config.bbclass#L31

Please let me know how best to proceed.

Thank you,
Stephen
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#127595): 
https://lists.openembedded.org/g/openembedded-devel/message/127595
Mute This Topic: https://lists.openembedded.org/mt/119827451/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to