Skip to content

Commit

Permalink
eficonfig: CTRL+S to save the boot order
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Heinrich Schuchardt <[email protected]>
  • Loading branch information
Masahisa Kojima authored and xypron committed Feb 10, 2023
1 parent 45f5319 commit 88df363
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/eficonfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down
3 changes: 3 additions & 0 deletions common/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions include/menu.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ enum bootmenu_key {
BKEY_PLUS,
BKEY_MINUS,
BKEY_SPACE,
BKEY_SAVE,

BKEY_COUNT,
};
Expand Down

0 comments on commit 88df363

Please sign in to comment.