]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
eficonfig: CTRL+S to save the boot order
authorMasahisa Kojima <masahisa.kojima@linaro.org>
Thu, 2 Feb 2023 09:24:44 +0000 (18:24 +0900)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Fri, 10 Feb 2023 12:05:39 +0000 (13:05 +0100)
The change boot order menu in eficonfig can have at most INT_MAX lines
and it is troublesome to scroll down to the "Save" entry.

This commit assigns CTRL+S to save the boot order.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Acked-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
cmd/eficonfig.c
common/menu.c
include/menu.h

index f365a988d4de024823c4f563e73288883551c026..0a17b8cf343b495fca5313f04f945209287ca326 100644 (file)
@@ -28,7 +28,7 @@ const char *eficonfig_menu_desc =
 static const char *eficonfig_change_boot_order_desc =
        "  Press UP/DOWN to move, +/- to change orde\n"
        "  Press SPACE to activate or deactivate the entry\n"
-       "  Select [Save] to complete, ESC to quit";
+       "  CTRL+S to save, ESC to quit";
 
 static struct efi_simple_text_output_protocol *cout;
 static int avail_row;
@@ -1983,6 +1983,10 @@ char *eficonfig_choice_change_boot_order(void *data)
                                eficonfig_menu_down(efi_menu);
 
                        return NULL;
+               case BKEY_SAVE:
+                       /* force to select "Save" entry */
+                       efi_menu->active = efi_menu->count - 2;
+                       fallthrough;
                case BKEY_SELECT:
                        /* "Save" */
                        if (efi_menu->active == efi_menu->count - 2) {
index cdcdbb2a185c23803f88dc28f68efb35882beb47..94514177e4e93e3190a6e13519a958895d1efddd 100644 (file)
@@ -503,6 +503,9 @@ enum bootmenu_key bootmenu_conv_key(int ichar)
        case CTL_CH('n'):
                key = BKEY_DOWN;
                break;
+       case CTL_CH('s'):
+               key = BKEY_SAVE;
+               break;
        case '+':
                key = BKEY_PLUS;
                break;
index 1e88141d6bf5f7eb77ee8c615a5648df9c27acc8..64ce89b7d2633f33666ac1a087172f585564b39a 100644 (file)
@@ -53,6 +53,7 @@ enum bootmenu_key {
        BKEY_PLUS,
        BKEY_MINUS,
        BKEY_SPACE,
+       BKEY_SAVE,
 
        BKEY_COUNT,
 };