]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
menu: always show the menu regardless of the number of entry
authorMasahisa Kojima <masahisa.kojima@linaro.org>
Thu, 28 Apr 2022 08:09:36 +0000 (17:09 +0900)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Tue, 3 May 2022 19:39:22 +0000 (21:39 +0200)
To make user aware of the menu entry selection, menu always
appears regardless of the number of entry.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Adjust test/py/tests/test_bootmenu.py
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
common/menu.c
test/py/tests/test_bootmenu.py

index 5fb2ffbd065d4ed8a3dd22dddf81e8d121be5b83..b577d80b4ff6467ce34fa90f8b03ced9f3eb7048 100644 (file)
@@ -271,7 +271,7 @@ int menu_get_choice(struct menu *m, void **choice)
        if (!m || !choice)
                return -EINVAL;
 
-       if (!m->prompt || m->item_cnt == 1)
+       if (!m->prompt)
                return menu_default_choice(m, choice);
 
        return menu_interactive_choice(m, choice);
index fb03fa417b7b5ac8e589f8076eb5d77edadd88cb..b4baa534aa20954145c265e122708fcc5ca3f9fb 100644 (file)
@@ -42,7 +42,5 @@ def test_bootmenu(u_boot_console):
     assert 'rc:0' in response
     u_boot_console.run_command('setenv bootmenu_default')
     u_boot_console.run_command('setenv bootmenu_0')
-    # Without bootmenu_0 no menu should be shown.
-    u_boot_console.run_command('bootmenu 2')
     u_boot_console.run_command('setenv bootmenu_1')
     u_boot_console.run_command('setenv bootmenu_2')